Time of Update: 2016-07-25
$sql3="CREATE TEMPORARY TABLE atmp_table(uid int(11),dnum int(20) not null)"; mysql_query($sql3); $sql3="INSERT into atmp_table(uid,dnum) SELECT uid,count(soid) as dnum FROM `cy_score2` where (nei='下載' or nei='下載試題')
Time of Update: 2016-07-25
extension_dir="/usr/local/php/etc/ext"#Load模組extension=ftp.so複製代碼#儲存退出至此,成功完成ftp擴充的載入。 您可能感興趣的文章:php ftp函數應用(範例,ftp類,建立目錄函式等)php自訂ftp類與調用執行個體php ftp類(上傳、下載、複製、移動等)仿CodeIgniter的FTP類的實現代碼php實現ftp上傳的類與調用樣本php ftp檔案上傳函數的簡單例子php
Time of Update: 2016-07-25
//在excel.php檔案中 $objActSheet = $objPHPExcel->getActiveSheet(); // 設定 欄目名稱 $objActSheet->setCellValue("b1", "卡號"); // 設定列的寬度 $objActSheet->getColumnDimension('b')->setWidth(20);//改變此處設定的長度數值 複製代碼2、字元被excel理解成數字了,一般就是把那個欄位設定成文本
Time of Update: 2016-07-25
本文是php-redis中文文檔的第二部分,接上篇,繼續介紹redis官方提供的一些命令的提示,有需要的朋友可以參考下。本文是php-redis中文文檔的第二部分,接上篇,繼續介紹redis官方提供的一些命令的提示,有需要的朋友可以參考下。mset (redis版本1.1以上才可以用)同時給多個key賦值$redis->mset(array('key0' => 'value0', 'key1' => 'value1')); multi, exec,
Time of Update: 2016-07-25
本文是php-redis中文文檔的第五部分,有需要的朋友可以參考下。本文是php-redis中文文檔的第五部分,有需要的朋友可以參考下。Hash操作hSet$redis->hSet('h', 'key1', 'hello');向名稱為h的hash中添加元素key1—>hello hGet$redis->hGet('h', 'key1');返回名稱為h的hash中key1對應的value(hello) hLen$redis->hLen('h');返回名稱為h的hash中元素個數
Time of Update: 2016-07-25
做統計圖表時,取出資料時需要用","分隔,但是我用迴圈累加字串時,不可避免最後會多一個","。比如我取出的1,2,3,4,5,但是我需要把這個串最後的那個逗號刪掉,而得到1,2,3,4,5。做統計圖表時,取出資料時需要用","分隔,但是我用迴圈累加字串時,不可避免最後會多一個","。比如我取出的1,2,3,4,5,但是我需要把這個串最後的那個逗號刪掉,而得到1,2,3,4,5。 解決方案:採用php的substr方法,文法: string substr(string string, int
Time of Update: 2016-07-25
$this_year = 2013;$text = 祝無雙,F,1982,廣東,普遍職員李三兵,M,1981,河北,普通職員趙樸秀,F,1980,韓國,專案經理EOT;$lines = explode("\n", $text); //將多行資料分開foreach ($lines as $userinfo) { $info = explode(",", $userinfo, 3); //僅分割前三個資料 $name = $info[0]; $sex = ($info[1] ==
Time of Update: 2016-07-25
echo function_exists('addcslashes');//檢測是否存在該函數echo get_magic_quotes_gpc().'';//檢測是否開啟自動轉義echo PHP_VERSION.'';//php版本資訊echo addcslashes("Who's John Adams?");echo '';$str = "Who's John Adams?";echo addslashes($str);?> 複製代碼輸出結果是否一樣呢?105.3.6Warning:
Time of Update: 2016-07-25
CREATE TABLE tbl_auth_user (user_id VARCHAR(10) NOT NULL,user_password CHAR(32) NOT NULL,PRIMARY KEY (user_id));INSERT INTO tbl_auth_user (user_id, user_password) VALUES ('theadmin', PASSWORD('chumbawamba'));INSERT INTO tbl_auth_user (user_id,
Time of Update: 2016-07-25
$r = print "Hello World"; 複製代碼這意味著print可用在一些複雜的運算式中,而echo則不行。但是,因為echo語句不要求返回任何數值,所已在代碼中echo語句的運行效率要略微快於print語句。2、include與require的區別include()與require()的功能也基本相同(包含),但在用法上也有一些不同,include()是有條件包含函數,而require()則是無條件包含函數。例如在下面代碼中,如果變數$a為真,則將包含檔案a.php:
Time of Update: 2016-07-25
$conn = mysql_pconnect($host,$user,$pwd);mysql_select_db($dbname,$conn); $result=mysql_query("select * from table_name where col_id ='test_id'", $conn);$result_detail=mysql_fetch_array($result);$item = $result_detail['col_id'];?>複製代碼備忘:作為高並發處理資料庫請求時,
Time of Update: 2016-07-25
function SmartyLen($params){extract($params);$len=strlen($text);$max=$length;for ($i=0;$i $chr=substr($text,$i,1); if(ord($chr)>0x80)//字元是中文 { $length++; $i++; $len--;
Time of Update: 2016-07-25
function set_writeable($file_name){if(@chmod($file_name,0555)){ echo "修改index.php檔案唯讀屬性成功";}else{ echo "修改index.php檔案唯讀屬性失敗,空間商不支援此操作!";}}set_writeable("index.php");?>
Time of Update: 2016-07-25
1. include有傳回值,而require沒有。2. include()包括並運行指定檔案 在處理失敗時include() 產生一個警告,被匯入的程式碼都會被執行1. include有傳回值,而require沒有。2. include()包括並運行指定檔案 在處理失敗時include() 產生一個警告,被匯入的程式碼都會被執行,而且這些程式在執行的時候會擁有和源檔案中呼叫到include()語句的位置相同的變數範圍。你可以匯入同一個伺服器中的靜態頁面。 3.
Time of Update: 2016-07-25
/** * author: goosman * blog: http://blog.csdn.net/lgg201 * mail: lgg860911@yahoo.com.cn */ $str = '01234567890120123456789'; function substr_remain_tag($s, $o, $l) { $is_match = preg_match_all( ;
Time of Update: 2016-07-25
本文是php-redis中文文檔的第三部分,接上篇,繼續介紹redis官方提供的一些命令的提示,有需要的朋友可以參考下。本文是php-redis中文文檔的第三部分,接上篇,繼續介紹redis官方提供的一些命令的提示,有需要的朋友可以參考下。lInsert在名稱為為key的list中,找到值為pivot 的value,並根據參數Redis::BEFORE | Redis::AFTER,來確定,newvalue 是放在 pivot 的前面,或者後面。如果key不存在,不會插入,如果
Time of Update: 2016-07-25
// Insecure Include// The following Include statement will// include and execute everything POSTed// to the serverinclude "php://input";?>複製代碼例2: Use data: to Include arbitrary code // Insecure Include// The following Include statement will//
Time of Update: 2016-07-25
function assoc_unique($arr, $key) { $tmp_arr = array(); foreach($arr as $k => $v) { if(in_array($v[$key], $tmp_arr)) { unset($arr[$k]); } else { $tmp_arr[] = $v[$key]
Time of Update: 2016-07-25
date_default_timezone_set("Asia/Hong_Kong");$time1 = strtotime(date("Y-m-d H:i:s")); //當前的系統時間$time2 = strtotime("2013-2-10 17:10:00"); //放假的時間$time3 = strtotime("2013-1-1"); //2013年元旦$sub1 = ceil(($time2 - $time1)/3600); //(60 秒*60分)秒/小時$sub2 =
Time of Update: 2016-07-25
使用 CodeIgniter 時出現了HTTP 500錯誤,查看日誌發現以下錯誤: CodeIgniter_2.0.2/.htaccess: Invalid command 'RewriteEngine', perhaps misspelled or defined by a module not included in the server configuration使用 CodeIgniter 時出現了HTTP 500錯誤,查看日誌發現以下錯誤: