Time of Update: 2018-12-07
PHP中文亂碼的原因及解決方案 原因:1.PHP頁面語言本身的編碼類別型不合適,這時候,你直接在指令碼中寫的中文肯定是亂碼,不用說資料庫了; 解決方案:選擇'UTF8'或者'gb2312',這樣客戶瀏覽器會自動選擇並出現正確的中文顯示。注意:'UTF8'或者'gb2312'都可以正確顯示中文的。 2.資料庫MySQL中的編碼類別型不正確。 解決方案:建立資料庫的時候,MySQL 字元集選擇'UTF8',MySQL
Time of Update: 2018-12-07
文章目錄 Coding tips I've been coding in PHP ever since I was 13, over the years I have seenmany different coding styles and standards being used. However most ofthem weren't
Time of Update: 2018-12-07
1 . 安裝libevent(Memcache用到了libevent這個庫用於Socket的處理) 可以用# ls -al /usr/lib | grep libevent 來查看是不是已經安裝完成了。 wget http://www.monkey.org/~provos/libevent-1.4.12-stable.tar.gz ./configure --prefix=/usr2 . 安裝Memcache wget
Time of Update: 2018-12-07
被PHP的檔案上傳下了一跳,這是我寫過的實現最簡單的檔案上傳了(俺寫過java\asp\c#)<?php$f=&$HTTP_POST_FILES['file'];$dest_dir='uploads';//設定上傳目錄$dest=$dest_dir.'/'.date("ymd")."_".$f['name']; //設定檔案名稱為日期加上檔案名稱避免重複$r=move_uploaded_file($f['tmp_name'],$dest);?><form a
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
關於作者王丹丹 , IBM 中國系統與技術中心軟體工程師,自從 2006 年加入 IBM,一直從事 Web 系統設計和開發工作,有五年 PHP 應用程式設計開發經驗。原文: http://www.ibm.com/developerworks/cn/opensource/os-cn-php-time/index.html==========================================================2009 年 11 月 26 日通常開發人員在寫程式的時候,
Time of Update: 2018-12-07
定義和用法mail() 函數允許您從指令碼中直接寄送電子郵件。如果郵件的投遞被成功地接收,則返回 true,否則返回 false。文法mail(to,subject,message,headers,parameters)參數描述to必需。規定郵件的接收者。subject必需。規定郵件的主題。該參數不能包含任何換行字元。message必需。規定要發送的訊息。headers必需。規定額外的前序,比如 From, Cc 以及 Bcc。parameters必需。規定 sendmail
Time of Update: 2018-12-07
一:魔術函數1。__construct() 執行個體化對象時被調用, 當__construct和以類名為函數名的函數同時存在時,__construct將被調用,另一個不被調用。 2。__destruct() 當刪除一個對象或對象操作終止時被調用。 3。__call() 對象調用某個方法, 若方法存在,則直接調用; 若不存在,則會去調用__call函數。 4。__get() 讀取一個對象的屬性時, 若屬性存在,則直接返回屬性值; 若不存在,則會調用__get函數。 5。__set() 設定一個對象
Time of Update: 2018-12-07
//運行前,你的電腦需要可以運行php的環境,下面,是我的一些做法 //這個是一個運行時的頁面 //show.html ---名字 -------------------------------- <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html><head><meta
Time of Update: 2018-12-07
View Code
Time of Update: 2018-12-07
View Code
Time of Update: 2018-12-07
1.boolean sort(array target_array [,int sort_flags]) :按數字和字母的順序排序2.boolean rsort(array target_array [,int sort_flags]) :以降序對數組元素進行排序3.void asort(array target_array [,int sort_flags]) :對關聯陣列排序(保留原來的索引關係)4.void arsort(array target_array [,int
Time of Update: 2018-12-07
注意:如$str="this is a book!";我們有$str[0]或$str{0}表示"t",以此類推的說法哈//去除空格和其他符號1. string trim(string str [ , string charlist] ) :兩邊去空格或其它字元2. string ltrim( string str [ , string charlist ]) :左邊去空格或其它字元 3. string rtrim( string str [ , string charlist] )
Time of Update: 2018-12-07
//----------POSIX風格的Regex//用於簡單的搜尋和匹配1.int ereg( string pattern , string str [ , array regs ]) :搜尋成功則返回正數,否則返回負數。該函數是區分大小寫2.int eregi( string pattern , string str [, array regs ]) :搜尋和匹配指定的Regex。它只是不區分大小寫,其他和ereg()函數是一致的//用於搜尋和替換3.string
Time of Update: 2018-12-07
<?php header("Content-type:image/png"); //$num=$_GET['num']; 這裡本來是想擷取的,但是為了方便顯示,用了下面一條語句直接得到了。 $num="we5523"; $imagewidth=80; $imageheight=18; $numimage= imagecreate($imagewidth, $imageheight);//按照上面的大小建立一張圖片
Time of Update: 2018-12-07
編輯器載入中...對於php中,本人的看法有兩種,其實不止的,只是個人的看法而已。只需要在有需要輸出的導航條的位置上放上這一句就可以完成匯入導航條的功能,非常方便。另一個方法,也是我本人不太贊同的做法,就是用iframe架構模式,分為上下兩部分,上方放置導航資訊,下方放置內容。不過,我不推薦這種做法的原因是,較少網站會使用這種方法,而已有些瀏覽器也不太支援的。不過這些年的瀏覽器也升級了不小。請大家評論。因為是第一次寫部落格,可能有不好的地方。
Time of Update: 2018-12-07
<?php$url="http://www.otcmarkets.com/edgar/ajax/GetFilings.json";$keysArr = array( "symbol"=>"FSCND", "body"=>"[object HTMLDivElement]", "progressBarBody"=>"[object HTMLQuoteElement]", "progressBarOn"=>"true",
Time of Update: 2018-12-07
注意 1.在socket_bind的時候ip地址不能真迴環地址如127.0.0.1 2.server.php後台跑起來的時候 nohup php server.php > /var/tmp/a.log 2>&1 &一: udp 方式1) server.php<?php//error_reporting( E_ALL );set_time_limit( 0 );ob_implicit_flush();$socket = socket_create(
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
請注意使用writeImages()而不是writeImage() 1 <?php 2 try 3 { 4 // Read in the animated gif 5 $animation = new Imagick("animation.gif"); 6 7 // Loop through the frames 8 foreach ($animation as $frame) 9 {10 // Thumbnail