Time of Update: 2016-06-13
關於處理數組中同類統計的解決方案(PHP) $arrItem = array(Array (10000,'中國',1),Array (10000,'中國',3),Array (20000,'美國',2),Array (30000,'法國',5));$arr = array();foreach($arrItem as $v){??? $arr[$v[0]] = isset($arr[$v[0]]) ? $arr[$v[0]] + $v[2] : $v[2];??? print_r($arr)
Time of Update: 2016-06-13
PHP 反射機制詳解 以及外掛程式架構實現 1。用途:該擴充分析php程式,匯出或提取出關於類、方法、屬性、參數等的詳細資料,包括注釋。Reflection可以說是對php庫函數:“Classes/Objects 類/對象函數”的一個擴充。主要用在通過程式檢測現有php程式內部關於類、方法等資訊,並做出處理。2。API概覽:class Reflection { }interface Reflector { }class ReflectionException extends
Time of Update: 2016-06-13
Fuel PHP架構介紹 Fuel
Time of Update: 2016-06-13
php 加密解密類(含公開金鑰) ?key; } srand((double)microtime()*1000000); $encrypt_key = md5(rand(0,32000)); $ctr=0; $tmp = ""; for ($i=0;$ikeyED($tmp,$key); } public function decrypt($txt,$key="") { if(empty($key)){ $key=$this->key; } $txt =
Time of Update: 2016-06-13
DoitPHP 1.2正式發布 海內升明月,天涯共此時。致此中秋佳節之際,祝各位同仁Happy Mid-Autumn Day。在這裡高興地我向各位宣布:DoitPHP 1.2
Time of Update: 2016-06-13
php實現url偽靜態化,全過程詳解
Time of Update: 2016-06-13
PHP反射API 反射是什嗎?它是指在PHP運行狀態中,擴充分析PHP程式,匯出或提取出關於類、方法、屬性、參數等的詳細資料,包括注釋。這種動態擷取的資訊以及動態調用對象的方法的功能稱為反射API。反射API概覽:class Reflection { }interface Reflector { }class ReflectionException extends Exception { }class ReflectionFunction implements Reflector {
Time of Update: 2016-06-13
php訊息佇列 php-通過共用記憶體實現訊息佇列和進程通訊的兩個類實現訊息佇列,可以使用比較專業的工具,例如:Apache ActiveMQ、memcacheq…..,下面是兩個基本簡單的實現方式:使用memcache方法來實現memcache = Yl_Memcache::singleton ();$this->name = $name;$this->prefix = $prefix;$this->maxSize = $max_size;$this->add ( 'front', 0
Time of Update: 2016-06-13
PHP Header 緩衝 --- Header 參數說明 1. Accept:告訴WEB伺服器自己接受什麼介質類型,*/* 表示任何類型,type/* 表示該類型下的所有子類型,type/sub-type。2. Accept-Charset:?? 瀏覽器申明自己接收的字元集Accept-Encoding:
Time of Update: 2016-06-13
在PHP中使用SMTP發送郵件
Time of Update: 2016-06-13
PHP上傳檔案 if ((($_FILES["file"]["type"] == "image/gif")|| ($_FILES["file"]["type"] == "image/jpeg")|| ($_FILES["file"]["type"] == "image/pjpeg"))&& ($_FILES["file"]["size"] ? {? if ($_FILES["file"]["error"] > 0)??? {??? echo "Return Code: " .
Time of Update: 2016-06-13
php 檢測網址是否有效 1. ?網址的格式:?function checkUrl($weburl) { return !ereg("^http(s)*://[_a-zA-Z0-9-]+(.[_a-zA-Z0-9-]+)*$", $weburl); }?2 .?判斷http 地址是否有效?function url_exists($url){$ch = curl_init(); curl_setopt($ch, CURLOPT_URL,$url);
Time of Update: 2016-06-13
PHP基礎知識總結 看了些PHP的基礎知識,自己在這裡總結下:1,在HTML嵌入PHP指令碼有三種辦法:script?language="php">//嵌入方式一echo("test");script>//嵌入方式二echo?"test2";?>php//嵌入方式三echo?"test3";?>還有一種嵌入方式,即使用和Asp相同的標記,但要修改PHP.ini
Time of Update: 2016-06-13
Windows7系統內容安裝配置PHP開發環境
Time of Update: 2016-06-13
thinkphp 產生靜態檔案 配置 $this->buildHtml('hello', 'user/','index');這樣就在user目錄下生產了? hello.shtml還有緩衝配置順便配置下生產 緩衝 就是 點了 不是立即產生等到達一定時間自動生產靜態頁面 相當實用在cofig.php 配置if (!defined('THINK_PATH')) exit();return array(?'HTML_CACHE_ON'=>true,?'HTML_CACHE_TIME'=>10,//
Time of Update: 2016-06-13
PHP資料操作類 cachePath . strtoupper(md5($fileName)).".".$this->cacheFileExt;$this->cacheFileName=$cacheFileName; } /* * 根據當前動態檔案產生快取檔案名 */function getCacheFileName() {return $this->cacheFileName; } /** * 串連資料庫 * * @access
Time of Update: 2016-06-13
php 不重新編譯 添加 ftp 模組 以添加ftp模組為例子進入源碼目錄cd php-5.2.9/ext/ftp#運行phpize產生configure/usr/local/php529/bin/phpize?Configuring for:PHP Api Version:???????? 20041225Zend Module Api No:????? 20060613Zend Extension Api No:?? 220060519如果出現Cannot find autoconf.
Time of Update: 2016-06-13
php合成或者建立gif動畫 1. 首先需要確認GD庫是否正常。?2. 如何是合成圖片,請確保把分解的圖片放在frames的檔案夾裡面。?3. GIFEncoder.class.php 類??"Does not supported function for only one image!", 'ERR01' =>"Source is not a GIF image!", 'ERR02' =>"Unintelligible
Time of Update: 2016-06-13
php基本入門 搭環境。 如果你的項目名中有空格的話,你需要更改項目得名字,名字中不允許出現空格,否則,解析不到。 (1)更改apache下的conf檔案夾下的httpd.conf檔案中的連接埠,預設8080連接埠是被佔用的、 (2)點擊項目下的.exe執行檔案。然後再右下角會出現一個表徵圖,左鍵點擊表徵圖,點擊 全部啟動。 (3)
Time of Update: 2016-06-13
PHP之類 關於類的函數一、與Java相同的類知識1,類和對象公有、私人、建構函式、thisClass person{ public $length; //成員變數 __construct(){ //構造方法 } public function getLength(){ //成員方法 echo $this->length; } private function myDisplay(){ //私人方法 } //靜態變數、靜態方法}2,繼承和派生 (核心)(1