Time of Update: 2016-07-25
/***********************@filename - path to the image*@tmpname - temporary path to thumbnail*@xmax - max width*@ymax - max height*/function resize_image($filename, $tmpname, $xmax, $ymax){ $ext = explode(".", $filename); $ext = $ext[count($ext)
Time of Update: 2016-07-25
$i = imagecreatefromjpeg("image.jpg");for ($x=0;$x for ($y=0;$y $rgb = imagecolorat($i,$x,$y); $r = ($rgb >> 16) & 0xFF; $g = ($rgb >> & 0xFF; $b = $rgb & 0xFF; $rTotal += $r; $gTotal += $g;
Time of Update: 2016-07-25
mysql_get_server_info()函數是php內建系統函數。mysql_get_server_info() 函數返回 MySQL 伺服器的資訊。如果成功,則返回 MySQL 伺服器的版本號碼,如果失敗,則返回 false。文法:mysql_get_server_info(connection)參數:connection 可選。規定 MySQL 串連。如果未規定,則使用上一個串連。$con = mysql_connect("localhost", "hello",
Time of Update: 2016-07-25
本文執行個體講述了php隨機擷取金山詞霸每日一句的方法。分享給大家供大家參考。具體實現方法如下:header('Content-Type:text/html; charset=utf-8');$nowyear=date("Y");$nowmouth = date('m');$nowday = date('d');$date =
Time of Update: 2016-07-25
php 無重新整理 接受檔案 function upload_pic($path){ $filename = 'userfile'; $pic_path = ''; $picname = $_FILES[$filename]['name']; $picsize
Time of Update: 2016-07-25
代碼描述:基於php的水質查詢api調用代碼執行個體關聯資料:水品質介面地址:http://www.juhe.cn/docs/api/id/34 // +----------------------------------------------------------------------// | JuhePHP [ NO ZUO NO DIE ]// +------------------------------------------------------
Time of Update: 2016-07-25
php產生數字字母的驗證碼圖片header ('Content-Type: image/png');$image=imagecreatetruecolor(100, 30);$color=imagecolorallocate($image, 255, 255, 255);imagefill($image, 20, 20, $color);//只含有數字// for($i=0;$i // $font=6; // $x=rand(5,10)+$i*100/4; // $y=rand(8, 15
Time of Update: 2016-07-25
代碼描述:基於php的地產資料介面調用代碼執行個體介面地址:http://www.juhe.cn/docs/api/id/47 // +----------------------------------------------------------------------// | JuhePHP [ NO ZUO NO DIE ]// +---------------------------------------------------------------
Time of Update: 2016-07-25
本文執行個體講述了php實現編輯和儲存檔案的方法。分享給大家供大家參考。具體如下:save_file.php:session_start(); $handle = fopen($_POST['original_file_name'], "w"); $text = $_POST['file_contents']; if(fwrite($handle, $text) == FALSE){ $_SESSION['error'] = 'There was an error'; }else{ $_
Time of Update: 2016-07-25
在一台新伺服器上,安裝新網站,之前只放至了一個網站。是伺服器商配置好的,非Integration
Time of Update: 2016-07-25
class emailui{ static function runlog($mode = 'SMTP',$b = '',$c = '',$d='') { } static function sendmail($toemail, $subject, $message, $from='',$cfg = array(), $sitename='') { global $db_wwwname,$mail_port,$mail_id,$mail_server,$mail_pw,$mail_
Time of Update: 2016-07-25
define('MSB_VERSION', '1.0.0'); define('MSB_NL', "\r\n"); define('MSB_STRING', 0); define('MSB_DOWNLOAD', 1); define('MSB_SAVE', 2); define('__SEP__', "/*sep*/" ); set_time_limit( 600 ); class MySQL_Backup { var $server = '
Time of Update: 2016-07-25
header("content-type:text/html;charset=gbk"); ini_set("date.timezone","Asia/chong"); //判斷檔案是否為空白 if(empty($_FILES)){ echo"上傳檔案過大"; exit; } //判斷檔案上傳是否有錯誤 if($_FILES['pic']['error']){ echo "上傳檔案"
Time of Update: 2016-07-25
## PHPZip v1.2 by Sext (sext@neud.net) 2002-11-18# (Changed: 2003-03-01)## Makes zip archive## Based on "Zip file creation class", uses zLib##class PHPZip{function Zip($dir, $zipfilename){ if (@function_exists('gzcompress')) {
Time of Update: 2016-07-25
vendor("PHPExcel176.PHPExcel"); // Create new PHPExcel object $objPHPExcel = new PHPExcel(); // Set properties $objPHPExcel->getProperties()->setCreator("ctos") ->setLastModifiedBy("ctos") ->setTitle(
Time of Update: 2016-07-25
header("Content-type:text/html; charset=utf-8"); class Collection{ private $_members=array(); private $_onload; private $_isLoaded=false; public function startLoad(){ $this->_checkCallback(); } public function
Time of Update: 2016-07-25
/** array unique_rand( int $min, int $max, int $num )* 產生一定數量的不重複隨機數* $min 和 $max: 指定隨機數的範圍* $num: 指定產生數量*/function unique_rand($min, $max, $num) { $count = 0; $return = array(); while ($count $return[] = mt_rand($min, $max);
Time of Update: 2016-07-25
class ption{ private static $original = array('=', '+', '/'); private static $later = array('O0O0O', 'o0O0o', 'oo00o'); function __construct() { } private static function md5($skey = '') { $skey = $
Time of Update: 2016-07-25
function mkdirs($dirname,$mode=0777) //建立目錄(目錄, [模式]) { if(!is_dir($dirname)) { mkdirs($dirname,$mode); //如果目錄不存在,遞迴建立 return mkdir($dirname,$mode); } return true; } function
Time of Update: 2016-07-25
$getIp=$_SERVER["REMOTE_ADDR"]; echo 'IP:',$getIp; echo ''; $content = file_get_contents("http://api.map.baidu.com/location/ip?ak=7IZ6fgGEGohCrRKUE9Rj4TSQ&ip={$getIp}&coor=bd09ll"); $json = json_decode($content); echo 'log:',$json->{'content'}