前面我們和大家分享了兩篇PHP學習記錄分享,本文繼續和大家分享PHP學習記錄分享三,希望能協助到大家。
34. //兩種參數集合_POST() $_REQUEST
function input($arr,$brr){ //var_dump($brr['json']);die;$array=array();if($brr['json']=='undefined' ||$brr['json']==NULL){foreach($brr as $k=>$v){$array[$k]=$v;}}else{foreach($arr as $k=>$v){$array[$k]=$v;}}return $array;}
$input= input(_POST(),$_REQUEST);$gh = $input['gh'];
對傳來的參數進行統一,可同時用_POST和_REQUEST,
35.java學習 :https://course.tianmaying.com/java-basic
36.<?php $file = fopen("test.txt","r"); ?>
fopen() 函數開啟檔案或者 URL。 如果開啟失敗,本函數返回 FALSE。
37. 變數是儲存資訊的容器:http://www.w3school.com.cn/php/php_variables.asp38.
38. sql判斷資料庫中該表是否在:https://zhidao.baidu.com/question/330963972518590485.html
39. PHP file_exists() 函數 file_exists() 函數檢查檔案或目錄是否存在。
40.使用SVN上傳代碼如果發現錯誤,看log日誌,查看一下哪裡不小心改了,不要只看自己改的那部分,防止不小心動了其他代碼,自己卻不知道!
41.
$gh_db = ($_REQUEST['gh']=='gh_0d75bc84fdf3') ? 'ecs273_dz': $_REQUEST['gh']; $sql = "select * from information_schema.columns WHERE TABLE_SCHEMA='$gh_db' AND table_name = 'ecs_goods' and column_name ='freight_template'"; //判斷資料表是否有該欄位$row1 = $db->getRow($sql);if($row1){$str=',freight_template'; //判斷然後拼裝sql語句$str1=",'$freight_template'";$str2="freight_template = '$freight_template', ";}else{$str='';$str1='';$str2='';}
42. php strlen()函數返回字串的長度
43. PHP strpos()函數 檢索字串中內指定的字元或文本,用來尋找長字串中的特定字串44. php常量 用來貫穿整個指令碼自動全域
<?phpdefine("GREETING", "Welcome to www.php.cn!", true);echo greeting;?>