Time of Update: 2017-01-13
<?php教程//此程式實現php畫柱狀圖,開發股票網站的朋友經常會碰到在產生k線圖片,現在我們來看看一款利用php根據數組資料產生k線圖片。//它的設計思想是:首先以用imagecreate()來產生一個空白圖形;其程式實現如下://需要兩種不同的顏色,正數一個 負數一個 ,一個資料數組,$path為儲存圖片的地址$data = array ("-1174.58","-1865.41","1961.24","-1174
Time of Update: 2017-01-13
class smallpic{ private $src_pic;//原圖 private $ico_pic = "003.png";//浮水印圖 private $ico_text = "浮水印";//浮水印文字 private $small_width;//縮圖寬度 private
Time of Update: 2017-01-13
session_save_path,可重新定義目錄。*/$sesssavepath = dirname(__file__)."/../data/sessions/";if(is_writeable($sesssavepath) && is_readable($sesssavepath)){ session_save_path($sesssavepath); }session_start();$vstr = '';for($i=0; $i<4; $i++)
Time of Update: 2017-01-13
在php中給圖片增加浮水印有imagecreatefromjpeg imagecreatefrompng imagecopymerge imagejpeg就成了,只要你設定原圖與浮水印圖片就成了,下面看執行個體。*/ 代碼如下複製代碼 header("content-type:
Time of Update: 2017-01-13
本文章提供這款圖片處理類,他可以做的事情有把圖片產生縮圖,可能給圖片增加浮水印以及擷取圖片資訊,算是比較實用代碼又簡潔的函數*/ 代碼如下複製代碼 class image{ public $info=array(); function __construct() { !extension_loaded('gd') && exit("www.111cn.net提示:伺服器環境不支援gd庫")
Time of Update: 2017-01-13
本文章提供一款php教程產生驗證碼詳細教程,前面是講關於產生驗證核心代碼,後面是一款產生與調用的方法。 代碼如下複製代碼 <?php //header("content-type:image/png"); $num ='1234'; $imagewidth=60; $imageheight=18;$numimage = imagecreate($imagewidth,$imageheight);
Time of Update: 2017-01-13
<?php class simpleimage { var $image; var $image_type; function load($filename) { $image_info = getimagesize($filename); $this->image_type = $image_info[2]; if( $this->image_type == imagetype_jpeg ) { $this->image =
Time of Update: 2017-01-13
imagemagic官方去除圖片背景的命令列模式: 代碼如下複製代碼 convert -size 140x80 xc:none -fill grey -gravity northwest -draw "text 10,10
Time of Update: 2017-01-13
代碼如下複製代碼 <?php$imagedraw = new imagick();$pixel = new imagickpixel('gray');$pixel->setcolor('black');$imagedraw->newimage(100, 75, $pixel);$draw = new imagickdraw();$draw->setfont('bookman-demiitalic');$draw->setfontsize(12);$
Time of Update: 2017-01-13
代碼如下複製代碼 $ch_str="你要產生中文驗證碼漢字";$str=array();for ($i=0;$i<strlen($ch_str);$i+=3){ $str[]=$ch_str[$i].$ch_str[$i+1].$ch_str[$i+2];}//圖片的長和高$image_x=200;$image_y=100;$im =
Time of Update: 2017-01-13
<? header ("content-type: image/png"); 代碼如下複製代碼 $newimg = imagecreate(250,250); 由於映像還是空白的,因此你可能會希望用一些彩色來填充它。你需要首先使用imagecolorallocate()函數用其rgb值為這種顏色指定一個名字,這一函數的格式為imagecolorallocate([image], [red], [green],
Time of Update: 2017-01-13
.jpgraph開源項目介紹jpgraph是一個物件導向圖形建立函數庫。可用它來產生柱狀圖,餅狀圖,甘特圖,網狀圖等常用到的一些圖形。支援的圖片格式有gif,jpg和png。jpgraph是一個開源的利用php教程編寫的專門提供圖表的類庫。它使得作圖變成了一件非常簡單的事情,你只需從資料庫教程中取出相關資料,定義標題,圖表類型等內容,你只需要學習掌握為數不多的jpgraph內建函數(可以參照jpgraph附帶例子學習),利用簡單的幾行代碼就可以做出超酷超炫的圖表來!2.jpgraph下載安裝及使
Time of Update: 2017-01-13
代碼如下複製代碼 function uploadimage($upname,$smallmark=1,$dstsw,$dstsh=0,$path_dim,$path_xim,$newname,$smallname=0,$filetype="null") { global $webaddr,$_files,$my; $phpv=str_replace('.', '',
Time of Update: 2017-01-13
代碼如下複製代碼 function resizeimage($image,$width,$height,$scale) { list($imagewidth, $imageheight, $imagetype) = getimagesize($image); $imagetype = image_type_to_mime_type($imagetype); $newimagewidth = ceil($width * $scale); $
Time of Update: 2017-01-13
代碼如下複製代碼 class securecode{ private static $instance=null; private $code = ''; private $fontfile; private $validate; private $image;
Time of Update: 2017-01-13
自訂函數實現金字塔 代碼如下複製代碼 <?php/** * 金字塔 * string fun_py(int $rows = 9, bool $sort=true) * $rows 表示行數 必須為整數 並且必須在1-20之間 * $sort 表示排序 true表示正序 FALSE表示倒序 */function fun_py($rows = 9, $sort=true){ if ($rows<1 ||
Time of Update: 2017-01-13
代碼如下複製代碼 <?php/** * * @author http://www.111cn.net * Created on 2014-4-1 * @param array $array * @param int [optional] $length * @return array */function
Time of Update: 2017-01-13
代碼如下複製代碼 <?php/**用PHP判斷遠程圖片(檔案)是否存在*http://www.111cn.net*/function check_remote_file_exists($url) { $curl = curl_init($url); // 不取回資料 curl_setopt($curl, CURLOPT_NOBODY,
Time of Update: 2017-01-13
其實主要就是用到了php的strtotime這個函數,strtotime('n day'),樣本如下: 代碼如下複製代碼 $days=array();for($i=0;$i<=7;$i++){ //這裡數字根據需要變動 $days[]=date("Y-m-d",strtotime('-'.$i.'day'));}echo '<pre>';print_r($days); 結果將顯示如下: 代碼如下複製代碼
Time of Update: 2017-01-13
例子 代碼如下 複製代碼 echo $str = 'PHP點點通'; echo strlen($str); //3*1+3*3=12 echo mb_strlen($str, 'gb2312'); //3*1+3*2=9 echo