PHP學習記錄分享三

來源:互聯網
上載者:User
前面我們和大家分享了兩篇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;?>

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.