php產生縮圖代碼

/***********************@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)

php提取圖片的主要顏色

$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;

mysql_get_server_info()函數

mysql_get_server_info()函數是php內建系統函數。mysql_get_server_info() 函數返回 MySQL 伺服器的資訊。如果成功,則返回 MySQL 伺服器的版本號碼,如果失敗,則返回 false。文法:mysql_get_server_info(connection)參數:connection 可選。規定 MySQL 串連。如果未規定,則使用上一個串連。$con = mysql_connect("localhost", "hello",

php隨機擷取金山詞霸每日一句的方法

本文執行個體講述了php隨機擷取金山詞霸每日一句的方法。分享給大家供大家參考。具體實現方法如下:header('Content-Type:text/html; charset=utf-8');$nowyear=date("Y");$nowmouth = date('m');$nowday = date('d');$date =

無重新整理上傳圖片

php 無重新整理 接受檔案 function upload_pic($path){ $filename = 'userfile'; $pic_path = ''; $picname = $_FILES[$filename]['name']; $picsize

基於php的水質查詢api調用代碼執行個體

代碼描述:基於php的水質查詢api調用代碼執行個體關聯資料:水品質介面地址:http://www.juhe.cn/docs/api/id/34 // +----------------------------------------------------------------------// | JuhePHP [ NO ZUO NO DIE ]// +------------------------------------------------------

php產生數字字母的驗證碼圖片

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

基於php的地產資料介面調用代碼執行個體

代碼描述:基於php的地產資料介面調用代碼執行個體介面地址:http://www.juhe.cn/docs/api/id/47 // +----------------------------------------------------------------------// | JuhePHP [ NO ZUO NO DIE ]// +---------------------------------------------------------------

php實現編輯和儲存檔案的方法

本文執行個體講述了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{ $_

FastCGI 進程意外退出造成500錯誤

在一台新伺服器上,安裝新網站,之前只放至了一個網站。是伺服器商配置好的,非Integration

發送郵件的PHP類

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_

備份MySQL的php類

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 = '

php利用GD庫產生縮圖

header("content-type:text/html;charset=gbk"); ini_set("date.timezone","Asia/chong"); //判斷檔案是否為空白 if(empty($_FILES)){ echo"上傳檔案過大"; exit; } //判斷檔案上傳是否有錯誤 if($_FILES['pic']['error']){ echo "上傳檔案"

使用PHPZip解壓縮檔案

## 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')) {

php使用PHPExcel匯出excel代碼

vendor("PHPExcel176.PHPExcel"); // Create new PHPExcel object $objPHPExcel = new PHPExcel(); // Set properties $objPHPExcel->getProperties()->setCreator("ctos") ->setLastModifiedBy("ctos") ->setTitle(

PHP的Collection集合類

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

php產生一定數量的不重複隨機數

/** 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);

分享一個PHP加密解密的類

class ption{ private static $original = array('=', '+', '/'); private static $later = array('O0O0O', 'o0O0o', 'oo00o'); function __construct() { } private static function md5($skey = '') { $skey = $

用PHP批量產生圖片縮圖

function mkdirs($dirname,$mode=0777) //建立目錄(目錄, [模式]) { if(!is_dir($dirname)) { mkdirs($dirname,$mode); //如果目錄不存在,遞迴建立 return mkdir($dirname,$mode); } return true; } function

14行PHP代碼擷取用戶端IP地址經緯度及所在城市

$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'}

總頁數: 5203 1 .... 1869 1870 1871 1872 1873 .... 5203 Go to: 前往

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.