Time of Update: 2018-12-07
一、: Apache2.0.50 :http://httpd.apache.org/download.cgi PHP5.0.2 :http://windows.php.net/download/MYSQL5.0.2:http://dev.mysql.com/downloads/Zend2.5.2 :http://www.zend.com/store/free_download.php?pid=13] 軟體的安裝偶就不說了,其中只有PHP下的是zip包,直接解壓就可以了。
Time of Update: 2018-12-07
<?phpclass a { static public $obj; public function __construct(){ } static public function getInstance(){ if(empty(self::$obj)){ echo "執行執行個體化"; self::$obj = new a(); } return
Time of Update: 2018-12-07
<?php/*** PHP log 類 */class Config{ public static function getConfig (){ return array( 'LOG_FILE'=>'test.txt', 'LOG_LEVEL'=>75 //INFO ); }}class Log{ private $LogFile; private $logLevel; const
Time of Update: 2018-12-07
1.echo和print的區別 PHP中echo和print的功能基本相同(輸出),但是兩者之間還是有細微差別的。echo輸出後沒有傳回值,但print有傳回值,當其執行失敗時返回flase。因此可以作為一個普通函數來使用,例如執行下面的代碼後變數$r的值將為1。 $r = print "Hello World"; 這意味著print可用在一些複雜的運算式中,而echo則不行。但是,因為echo語句不要求返回任何數值,所已在代碼中echo語句的運行效率要略微快於print語句。
Time of Update: 2018-12-07
簡介:這是PHP學習筆記 (3)--運算子的詳細頁面,介紹了和php,有關的知識、技巧、經驗,和一些php源碼等。 class='pingjiaF' frameborder='0' src='http://biancheng.dnbcw.info/pingjia.php?id=338926' scrolling='no'>PHP學習筆記 (3)-運算子一、算術運算子 1、運算子優先順序: 先算乘除後算加減,遇到括弧先算括弧內
Time of Update: 2018-12-07
簡介:這是網友分享:二十五個頂級PHP模板引擎整理的詳細頁面,介紹了和php,有關的知識、技巧、經驗,和一些php源碼等。 class='pingjiaF' frameborder='0' src='http://biancheng.dnbcw.info/pingjia.php?id=323146'
Time of Update: 2018-12-07
1.引用檔案: 引用檔案的方法有兩種:require 及 include。require 的使用方法如 require(MyRequireFile.php); 。這個函數通常放在 PHP 程式的最前面,PHP 程式在執行前,就會先讀入 require 所指定引入的檔案,使它變成 PHP 程式網頁的一部份。常用的函數,亦可以這個方法將它引入網頁中。 include 使用方法如 include(MyIncludeFile.php);
Time of Update: 2018-12-07
Fast-CGI:./configure --prefix=/usr/local/php --enable-fastcgi --enable-force-cgi-redirect --with-config-file-path=/etc --with-zlib --with-mysql --with-xml --with-gd --enable-gd-native-ttf --enable-gd-jis-conv --with-freetype-dir --with-jpeg-dir
Time of Update: 2018-12-07
View Code
Time of Update: 2018-12-07
REMOTE_ADDR只能擷取訪問者本地串連中設定的IP,如中南民族大學校園網中自己設定的10.X.XXX.XXX系列IP,而這個函數擷取的是區域網路網關出口的IP地址, 如果訪問者使用Proxy 伺服器,將不擷取Proxy 伺服器的IP,而是擷取訪問者網關的真實IP。如果將這個函數應用到限IP訪問的網頁中,別人即使通過限IP訪問段中的Proxy 伺服器,也不能訪問該頁面。// 定義一個函數getIP()function getIP(){global $ip;if
Time of Update: 2018-12-07
<?phpfunction map($fun, $list,$params=array()){ $acc=NULL; $last=array_push($params, NULL,$acc)-1; foreach($list as $params[$last-1]){ //第一次見這種寫法感覺很神奇 $params[$last]=call_user_func_array($fun , $params ); }
Time of Update: 2018-12-07
沒法清空檔案夾內容 只能清空指定連結緩衝<?phpfunction clearVarnish($ip,$url,$host=null){ $errstr = ''; $errno = ''; $varnist_arr = isset($host) ? $host : C('VARNISH_LIST'); foreach ($varnist_arr as $v){ $fp = fsockopen ($ip, 2000, $errno,
Time of Update: 2018-12-07
唉 通宵上項目發現一個圖片檢測方法在本地很快 上到伺服器上檢測卡死。<?php $img_exists = get_headers($pic,1); if(!empty($img_exists) && $img_exists[0] =='HTTP/1.1 200 OK' && $img_exists['Content-Length']!=18771){ $model_show .=
Time of Update: 2018-12-07
<?php/** * @author:xiaojiang * PHP 實現explort();功能 */$str = ',1,2,3,4,321321,aaa,bbb';function myExplode($seg,$str,$limit=0){ $_ret = array(0=>''); $len = strlen($str); $slen = strlen($seg); $_limit = 0; for($i=0; $i<$len; $i++){
Time of Update: 2018-12-07
思維導圖 介紹 前幾篇系列文章,我比較關注的是<PHP 雜談《重構-改善既有代碼的設計》之一
Time of Update: 2018-12-07
介紹策略模式:定義了演算法族,分別封裝起來,讓它們之間可以互相替換,此模式讓演算法的變化獨立於使用演算法的客戶。 封裝:把行為用介面封裝起來,我們可以把那些經常變化的部分,從當前的類中單獨取出來,用介面進行單獨的封裝。互相替換:我們封裝好了介面,通過指定不同的介面實作類別進行演算法的變化。 思維導圖我來解釋下這個思維導圖的過程:1.Joe做了一套相當成功的類比鴨子的遊戲。設計了一個超類Duck,然後讓各種鴨子繼承這個類。 2.後來客戶提出要讓鴨子有飛的能力。所以Joe就在超類中加了個fly()方
Time of Update: 2018-12-07
簡介:這是資料結構&演算法(PHP描述) 三元組 Triplet的詳細頁面,介紹了和php,有關的知識、技巧、經驗,和一些php源碼等。 class='pingjiaF' frameborder='0' src='http://biancheng.dnbcw.info/pingjia.php?id=339825' scrolling='no'> 1 <?php 2 /** 3 * 三元組 Triplet 4 * 5 */ 6 class Triplet 7 { 8
Time of Update: 2018-12-07
簡介:這是PHP 非同步呼叫 後台調用 持續執行 中斷連線/瀏覽器的詳細頁面,介紹了和php,有關的知識、技巧、經驗,和一些php源碼等。 class='pingjiaF' frameborder='0' src='http://biancheng.dnbcw.info/pingjia.php?id=336871' scrolling='no'>標題很怪,因為我也不知道怎樣用一句簡短的話來概括下面這部分內容。只是希望各位 PHP
Time of Update: 2018-12-07
簡介:這是用PHP實現通過Web執行C/C 程式的詳細頁面,介紹了和php,有關的知識、技巧、經驗,和一些php源碼等。 class='pingjiaF' frameborder='0' src='http://biancheng.dnbcw.info/pingjia.php?id=323728' scrolling='no'>Author: Mitchell Harper翻譯 :Kefeng Nie (kefeng_nie@163.com)Date :2002-10-15
Time of Update: 2018-12-07
簡介:這是php.net新聞攔截的詳細頁面,介紹了和php,有關的知識、技巧、經驗,和一些php源碼等。 class='pingjiaF' frameborder='0' src='http://biancheng.dnbcw.info/pingjia.php?id=323420' scrolling='no'><?//請自己修改下面變數.$newsnum=7;$space=20;$width=400;$headclass="class5";$lowerclass="class6";