Time of Update: 2016-07-25
/** php下載類,支援斷點續傳 * Date: 2013-06-30 * Author: fdipzone * Ver: 1.0 * edit: ww.jbxue.com* Func: * download: 下載檔案 * setSpeed: 設定下載速度 * getRange: 擷取header中Range */ class FileDownload{ // class start private $_speed = 512;
Time of Update: 2016-07-25
/*** 發送帶附件的郵件* by bbs.it-home.org*/class CMailFile { var $subject; var $addr_to; var $text_body; var $text_encoded; var $mime_headers; var $mime_boundary = "--==================_846811060==_"; var
Time of Update: 2016-07-25
//寫excel//Include class require_once(‘Classes/PHPExcel.php’); require_once(‘Classes/PHPExcel/Writer/Excel2007.php’); $objPHPExcel = new PHPExcel();/*** phpExcel匯出excel* by bbs.it-home.org*///Set properties 設定檔案屬性
Time of Update: 2016-07-25
/** css 更新類,更新css檔案內圖片的版本 * Date: 2013-02-05 * Author: fdipzone * Ver: 1.1 * Edit: bbs.it-home.org* Func: * update(); * * Ver: 1.1 增加search_child參數,可遍曆子檔案夾 */ class CSSUpdate{ private $csstmpl_path = null; private
Time of Update: 2016-07-25
$cfg['Servers'][$i]['user'] = 'root'; // MySQL user 訪問phpmyadmin使用的mysql使用者名稱 fg['Servers'][$i]['password'] = ''; // MySQL password (only needed對應上述mysql使用者名稱的密碼複製代碼D.認證方法 $cfg['Servers'][$i]['auth_type'] = 'cookie';
Time of Update: 2016-07-25
/*** 用php代碼產生excel或csv檔案中的序號*/public function loop(){ $loop = 0; $charnum = 65; for(; $loop $quotient = intval($loop / 26); $remainder = $loop % 26; $f = $quotient>0? chr($charnum+$quotient-1) : ''; $s = $remainder>=0?
Time of Update: 2016-07-25
/** 強制更新圖片緩存 * @param Array $files 待更新的圖片 * @param int $version 版本* @edit bbs.it-home.org*/ function force_reload_file($files=array(), $version=0){ $html = ''; if(!isset($_COOKIE['force_reload_page_'.$version])){ // 判斷是否已更新過
Time of Update: 2016-07-25
/** XML 檔案分析類 * Date: 2013-02-01 * Author: fdipzone * Ver: 1.0 * Edition bbs.it-home.org* func: * loadXmlFile($xmlfile) 讀入xml檔案輸出Array * loadXmlString($xmlstring) 讀入xmlstring 輸出Array */ class XMLParser{ /** 讀取xml檔案 *
Time of Update: 2016-07-25
[root@jbxue achievo]# php -v PHP 5.3.6 (cli) (built: Aug 19 2011 19:35:20) Copyright (c) 1997-2011 The PHP Group Zend Engine v2.3.0, Copyright (c) 1998-2011 Zend
Time of Update: 2016-07-25
for($i=0; $i echo $i.''; sleep(2); } ?> 複製代碼運行結果:等所有指令碼全部運行完成後,才輸出,因為資料未滿一個buffer的大小。例2,output_buffering=4096,輸出較少的資料(少於一個buffer),關閉output_buffering,修改php.ini的output_buffering=0 for($i=0; $i echo $i.str_repeat(" ",500).''; // 當接受到的256(
Time of Update: 2016-07-25
if(extension_loaded('gd')) { echo '可以使用gd'; foreach(gd_info() as $cate=>$value) echo "$cate: $value";}else echo '沒有安裝gd擴充';?> 複製代碼結果顯示為: 可以使用gdGD Version: bundled (2.0.34 compatible)FreeType Support: 1FreeType Linkage: with freetypeT1Lib
Time of Update: 2016-07-25
/** HTML Attribute Filter * Date: 2013-09-22 * Author: fdipzone * ver: 1.0 * edit: bbs.it-home.org* Func: * public strip 過濾屬性 * public setAllow 設定允許的屬性 * public setException 設定特例 * public
Time of Update: 2016-07-25
tar zxvf zlib-1.2.3.tar.gz cd zlib-1.2.3 ./configure --prefix=/usr/local/zlib make make install複製代碼2,安裝libpng tar zxvf libpng-1.2.8.tar.tar cd libpng-1.2.8 mv ./scripts/makefile.linux ./makefile make make install 複製代碼注意,這裡的makefile不是用./configure產生,
Time of Update: 2016-07-25
include('SimpleImage.php'); $image = new SimpleImage(); $image->load('picture.jpg'); $image->resize(250,400); $image->save('picture2.jpg');?> 複製代碼2,設定寬度,等比例縮放 include('SimpleImage.php'); $image = new SimpleImage();
Time of Update: 2016-07-25
php5 -m | grep -i gd 或者 php -i | grep -i --color gd 複製代碼2,如未安裝GD庫,則為伺服器安裝,方法如下 # 如果是源碼安裝,則加入參數 --with-gd# 如果是debian系的linux系統,用apt-get安裝,如下 apt-get install php5-gd# 如果是CentOS系的系統,用yum安裝,如下 yum install php-gd# 如果是suse系的linux系統,用yast安裝,如下 yast -i
Time of Update: 2016-07-25
/*** 判斷數組是否有序* by bbs.it-home.org*/function JudegSortArray($array) { if ($array [0] > $array [1]) { $flag = 1; } else { $flag = 0; } $temp = $flag; $len = count ( $array ); for($i = 1; $i if
Time of Update: 2016-07-25
[root@jbxue ~]# yum install php-gd*Setting up Install ProcessSetting up repositoriesbase 100% |=========================| 951 B 00:00update 100% |=========================| 951 B 00:00================================================GD Support
Time of Update: 2016-07-25
win8 64位旗艦版系統背景程式切換的兩種方法
Time of Update: 2016-07-25
/*** 遞迴擷取目錄與子目錄中的檔案* by bbs.it-home.org*/function readFileFromDir($dir) { if (!is_dir($dir)) { return false; } //開啟目錄 $handle = opendir($dir); while (($file = readdir($handle)) !== false) { //排除掉目前的目錄和上一個目錄 if
Time of Update: 2016-07-25
cd libpng-1.2.40mv scripts/makefile.linux ./Makefile #一定要使用script下的Makefile ,不要通過./configure複製代碼產生: makemake install複製代碼2,下載freetype庫,很多GD函數都需要此庫的支援http://ftp.twaren.net/Unix/NonGNU/freetype/freetype-2.3.5.tar.gz解壓後,進入目錄: cd