Time of Update: 2016-07-25
冬棗,冬甘蔗,冬瓜
Time of Update: 2016-07-25
用於示範PHP header()函數用法的代碼,介紹了refresh方法,老外寫的,當然不會太差,有需要的朋友參考下吧。php header頭資訊的例子。// override X-Powered-By: PHP:header('X-Powered-By: PHP/4.4.0');header('X-Powered-By: Brain/0.6b');// content language (en = English)header('Content-language: en');// last
Time of Update: 2016-07-25
轉載地址: http://blog.qita.in/?post=275 使用方法: require_once('360.php'); //http://blog.qita.infunction customError($errno, $errstr, $errfile, $errline){ echo "Error number: [$errno],error
Time of Update: 2016-07-25
為大家提供一個php 圖片操作類,可以為圖片加浮水印,有需要的朋友,可以參考下。圖片操作類的完整代碼。changeSize(80,50);//改變尺寸 $img->changeSize(80);//改變尺寸 $img->create(); $img->free(); $img = new Image('pic.jpg'); $img->addWatermark('logo.jpg', 50); //添加浮水印,第一個參數是浮水印的圖片地址,第二個參數是透明值 $img->create();
Time of Update: 2016-07-25
$json='[{"name":"qqdeliver","count":198,"average":119.8889},{"name":"load","count":259612,"average":141.9379},{"name":"gate","count":22480,"average":9.2209},{"name":"interact","count":40165,"average":429.3583},{"name":"save","count":2097845,"average"
Time of Update: 2016-07-25
php實現檔案強制下載的一段代碼,進入指定頁面後就彈出檔案下載對話方塊,恰如夢中那突如其來的流星雨,相當地酷類,哈哈。php 強制檔案下載的代碼。以上代碼,應用的是php頭部檔案(header)資訊的處理方法,如果你曾留心,就會發現程式員之家為大家收集的有關php強制檔案下載的代碼,大多採用的是這樣的方式。
Time of Update: 2016-07-25
用pear內建的mail類庫發郵件,可以用pear install 命令來安裝對應的庫 $body = "點我重建密碼";sendMail_smtp("xxxxxxxx@qq.com",'測試',$body);function
Time of Update: 2016-07-25
php實現文章內容分頁,根據內容長度自動分頁,有打算研究這塊的朋友,可以參考學習下。代碼如下:$conlen){ $j++; $listat[$j]=$conlen; break; } $endat=strpos($content,"\n",$lookat); if($endat>$conlen-$listlen/5 or
Time of Update: 2016-07-25
迅雷專用連結 普通下載地址頭部加入AA 尾部加入ZZ後通過base64編碼 最後頭部加上thunder:// 旋風專用連結 比較省事 普通下載地址直接通過base64編碼 最後頭部加上qqdl:// 快車專用連結 普通下載地址頭尾分別加入[FLASHGET]後通過base64編碼 最後頭部加上flashget:// 轉載地址:http://blog.qita.in/?post=334
Time of Update: 2016-07-25
根據要求,要在九個表格中寫入文字,標題可以編輯,有天氣、背景、表情可以選擇。最後產生一個圖片,圖片可以分享,結果也可以存入資料庫。github地址:9Diary GitHub /** * 添加日誌 * bgid 背景圖片 * title 日誌標題 * 表格標題與內容以'-|*dt*|-'分隔為1、2、3、4、6、7、8、9個表格中的資訊 *
Time of Update: 2016-07-25
本帖最後由 brotherlamp 於 2015-1-13 13:45 編輯
Time of Update: 2016-07-25
為大家介紹一個仿寫CodeIgniter的FTP類,功能很強大,有需要的朋友,可以參考下。1、檔案上傳類 ftp.php'','username'=>'','password'=>'','port'=>''...); */ public function __construct($config = array()) { if(count($config) > 0) { $this->_init($config); } } /** * FTP串連 * * @access
Time of Update: 2016-07-25
一個使用http協議實現檔案下載的php代碼,對於深入理解php檔案下載的原理,是個不錯的例子,有需要的朋友,真的應該參考學習下。1、檔案下載代碼0){ $file_data=fread($fp,$buffer); //統計讀取多少個位元組數 $file_count+=$buffer; //把部分資料返回給瀏覽器 echo $file_data; } //關閉檔案 fclose($fp);?>2、封裝函數:50){ echo "檔案太大不能下載"; return ; }*/
Time of Update: 2016-07-25
php實現遍曆當前檔案夾以及其下所有檔案與檔案夾的代碼,主要是用到了遞迴,有需要的朋友,可以參考學習下。代碼如下:read()) { if($file!='.' && $file!='..') { $path2 = $path.'/'.$file; if(is_dir($path2)) { echo $file."\t";
Time of Update: 2016-07-25
/** *php大括弧例解 *site http://bbs.it-home.org*/$arr=array(0=>123, 'name'=>'小豬');foreach($array as $k=>$v){ echo "select * from blog_blogs where blog_tags like '%{$arr[$k]}%' order by blog_id"; //加一個大括弧只是將作為變數的標誌符}echo '';foreach($array as $k=>$v){ echo
Time of Update: 2016-07-25
$basedir = dirname(__FILE__); echo $basedir; //將在頁面列印出一個這個檔案所在絕對路徑! ?> 複製代碼之後可以使用 define('ROOT', dirname(__FILE__));require_once ROOT.'/config/conf_mysql.php';複製代碼引入檔案幾個常用的PHP 的“魔術常量”名稱 說明__LINE__ 檔案中的當前行號。__FILE__
Time of Update: 2016-07-25
一個簡單的php檔案上傳類,可以自訂檔案名稱,可以設定允許上傳的檔案類型等,有需要的朋友,可以參考學習下。代碼如下: setOptions($options); //設定上傳時屬性列表 } function uploadFile($filefield){ $this->setOption('errorNum',0); //設定錯誤位 $this-
Time of Update: 2016-07-25
foreach ($prices as $key => $value)echo $key.'=>'.$value.''; 複製代碼如下所示的代碼將使用each()結構列印$prices數組的內容: while( $element = each($prices)){echo $element['key'];echo ' - ';echo $element['value'];echo '';}
Time of Update: 2016-07-25
$a="ABC";$b =&$a;echo $a;//這裡輸出:ABCecho $b;//這裡輸出:ABC$b="EFG";echo $a;//這裡$a的值變為EFG 所以輸出EFGecho $b;//這裡輸出EFG?>複製代碼2、函數的傳址調用 function test(&$a){$a=$a+100;}$b=1;echo $b;//輸出1test($b); //這裡$b傳遞給函數的其實是$b的變數內容所處的記憶體位址,通過在函數裡改變$a的值 就可以改變$b的值了echo
Time of Update: 2016-07-25
/*** API介面服務端* site http://bbs.it-home.org**/ require 'conn.php'; header('Content-Type:text/html;charset=utf-8'); $action = $_GET['action']; switch ($action) { //註冊會員 case"adduserinfo";