Time of Update: 2016-07-25
張映 男 28 tank 男 28 複製代碼2、php處理檔案,rexml.php /*** @ 使用Regex讀取xml檔案 @ Recoded By Androidyue @ site bbs.it-home.org ***/ $xml = ""; //唯讀模式開啟所讀取的檔案 $f =
Time of Update: 2016-07-25
class foo { function __call($name,$arguments) { print("Did you call me? I'm $name!"); print_r($arguments); print(""); } function doSecond($arguments) {
Time of Update: 2016-07-25
為大家說說ThinkPHP內建的分表演算法處理百萬級資料的例子,有需要的朋友,可以看看。從thinkphp中抽取出來的代碼,看看人家是如何?大資料分表的。資料表:house_member_0house_member_1house_member_2house_member_3model:class MemberModel extends AdvModel {protected $partition = array('field'=>'username','type'=>'id','num'=>'4
Time of Update: 2016-07-25
本文介紹下,php中開啟error_log日誌的方法,有需要的朋友,參考下吧。在php編程中,對於一些訪問沒有明顯錯誤提示的php頁面,可以通過error_log來做進一步的判定。但出於種種原因,有些伺服器並沒有開啟PHP的error_log功能。測試或其它需要時,可以開啟一下,方法如下。編輯php.ini,將log_errors設定為on: log_errors = On 然後,重啟apache即可。如成功開啟,就可以跟蹤到對應的錯誤提示: [Mon Sep 24 16:57:01 2012]
Time of Update: 2016-07-25
$url='http://bbs.it-home.org';print_r(get_headers($url));print_r(get_headers($url,1));?> 複製代碼輸出結果:Array([0] => HTTP/1.1 200 OK[1] => Date: Sat, 29 May 2004 12:28:13 GMT[2] => Server: Apache/1.3.27 (Unix) (Red-Hat/Linux)[3] => Last-Modified: Wed, 08
Time of Update: 2016-07-25
/*** php偽靜態* bbs.it-home.org*/$conn=mysql_connect("localhost","root","root")or dir("串連失敗");mysql_select_db("tb_demo",$conn);$sql="select * from news";$res=mysql_query($sql);header("content-type:text/html;charset=utf-8");echo "新聞列表";echo "添加新聞";echo "
Time of Update: 2016-07-25
複製代碼當register_globals=Off時,下一個程式接收時應該用$_GET['user_name']和$_GET['user_pass']來接受傳遞過來的值。(註:當的method屬性為post的時候應該用$_POST['user_name']和$_POST['user_pass'])當register_globals=On時,下一個程式可以直接使用$user_name和$user_pass來接受值。也就是說,register_globals註冊為全域變數,所以當On時,傳遞過來的值
Time of Update: 2016-07-25
header('Cache-control: private, must-revalidate'); //支援頁面回跳複製代碼2、使用session_cache_limiter方法。 session_cache_limiter('private, must-revalidate');
Time of Update: 2016-07-25
/*** xml2array() will convert the given XML text to an array in the XML structure.* Arguments : $contents - The XML text* $get_attributes - 1 or 0. If this is 1 the function will get the attributes as well as the tag values - this results in a
Time of Update: 2016-07-25
本文分享幾個php程式員面試題,共有6個部分,適合正在找工作的phper朋友們,快來參考下吧。專題推薦:php面試題及答案面試題11、 用PHP列印出前一天的時間格式是2006-5-10 22:21:212、 echo(),print(),print_r()的區別3、 能夠使HTML和PHP分離開使用的模板4、 如何?PHP、JSP互動?5、 使用哪些工具進資料列版本設定?6、 6、如何?字串翻轉?7、 最佳化mysql資料庫的方法。8、 談談交易處理9、
Time of Update: 2016-07-25
// 參數解釋// $string: 明文 或 密文// $operation:DECODE表示解密,其它表示加密// $key: 密匙// $expiry:密文有效期間function authcode($string, $operation = 'DECODE', $key = '', $expiry = 0) {// 動態密匙長度,相同的明文會產生不同密文就是依靠動態密匙$ckey_length = 4;// 密匙$key = md5($key ? $key :
Time of Update: 2016-07-25
本文介紹下,php程式中單引號與雙引號的區別,以及二者之間的效率問題,有需要的朋友,可以參考下。很多朋友,一直以為PHP中單引號和雙引號是互連的。” ” 雙引號裡面的欄位會經過編譯器解釋,然後再當作html代碼輸出。‘ ‘ 單引號裡面的不進行解釋,直接輸出。從字面意思上就可以看出,單引號比雙引號要快了。例如: $abc=’my name is tome’;echo $abc //結果是:my name is tomecho ‘$abc’ //結果是:$abcecho “$abc”
Time of Update: 2016-07-25
/** * 轉換html為txt文本的函數 * Edit bbs.it-home.org * at 2013/5/11*/function html2text($str){ $str = preg_replace("//is", "", $str); $str = preg_replace("//is", "", $str); $str = preg_replace("//i", "\n", $str); $str = preg_replace("//i", "\n\n",
Time of Update: 2016-07-25
query_cache_size=32M# The number of open tables for all threads. Increasing this value # increases the number of file descriptors that mysqld requires. # Therefore you have to make sure to set the amount of open files # allowed to at least 4096 in
Time of Update: 2016-07-25
function fun() { echo 'fun'; } $a = 'fun'; $a();?> 複製代碼上面的$a變數就是fun()函數,調用$a()和調用fun()是一樣的。另一種方法。調用PHP中的函數:mixed call_user_func ( callback $function [, mixed $parameter [, mixed $...]] )mixed call_user_func_array ( callback
Time of Update: 2016-07-25
一份比較基礎的php程式員面試題,考的比較基礎,但有很多細節的東西,如果基礎不牢的話,也很難過關的。有需要的朋友,參考下吧。1.在PHP中,當前指令碼的名稱(不包括路徑和查詢字串)記錄在預定義變數(1)中;而連結到當前頁面的URL記錄在預定義變數(2)中。2.執行程式段將輸出(3)。3.在HTTP 1.0中,狀態代碼 401 的含義是(4);如果返回“找不到檔案”的提示,則可用 header 函數,其語句為(5)。4.數組函數 arsort 的作用是(6);語句 error_reporting(
Time of Update: 2016-07-25
while (list($k,$v) = each($data)) {$encoded .= ($encoded ? "$sep" : "");$encoded .= rawurlencode($k)."=".rawurlencode($v);}Return $encoded;}Function post($url, $post, $cookie){$url = parse_url($url);$post = encode($data, ‘&’);$cookie =
Time of Update: 2016-07-25
一份面向中等水平的php程式員的面試題,考察php開發人員是否達到中等水平,包括了php與javascript等內容,有需要的朋友,參考下吧。以下內容,如果全部都很熟悉,說明基本具備了php開發的中等水平,一般可以去面試所謂的進階php開發工程師這個職位。沒有包含css,xml等的知識,也沒有包含網路技術方面的知識,僅僅是php,javascript。1:寫php有幾年了?php名字是什麼意思?2:熟悉javascript嗎? ajax(Asynchronous javascript and
Time of Update: 2016-07-25
//函數1,二維數組去掉重複值function array_unique_fb($array2D){ foreach ($array2D as $v){ $v = join(",",$v); //降維,也可以用implode,將一維數群組轉換為用逗號串連的字串 $temp[] = $v; } $temp = array_unique($temp); //去掉重複的字串,也就是重複的一維數組 foreach ($temp as
Time of Update: 2016-07-25
mysql_query("BEGIN"); mysql_query("INSERT INTO customerinfo (name) VALUES ('$name1')"; mysql_query("SELECT * FROM `orderinfo` where customerid=".$id"); mysql_query("COMMIT");複製代碼5)、鎖定表,最佳化交易處理: a.我們用一個 SELECT 語句取出初始資料,通過一些計算,用 UPDATE