php獲取$_POST同名參數數組的實現介紹_PHP教程

      編輯Tag賺U幣
      教程Tag:暫無Tag,歡迎添加,賺取U幣!

      推薦:解析link_mysql的php版
      本篇文章是對link_mysql的php版的實現進行了詳細的分析介紹,需要的朋友參考下 復制代碼 代碼如下: ?php $str_sql_read=select count(*) as num from userinfo; $str_sql_del=delete from userinfo where id =1; $res =link_mysql(read,$str_sql_read); $res_del =link_

      本篇文章是對php獲取$_POST同名參數數組的實現方法進行了詳細的分析介紹,需要的朋友參考下  

      今天寫php的時候發現$_POST["arr"]無法獲取參數arr的數組,記錄一下。
      例如有以下表單需要提交:

      復制代碼 代碼如下:
      <input type="checkbox" name="arr" value="" />
      <input type="checkbox" name="arr" value="" />
      <input type="checkbox" name="arr" value="" />
      <input type="checkbox" name="arr" value="" />


      使用$_POST["arr"]只能獲得最后選擇的復選框的值,要獲得全部選中的復選框的值需要把表單修改成下面:

      復制代碼 代碼如下:
      <input type="checkbox" name="arr[]" value="" />
      <input type="checkbox" name="arr[]" value="" />
      <input type="checkbox" name="arr[]" value="" />
      <input type="checkbox" name="arr[]" value="" />


      這樣就可以使用$_POST["arr"]獲得全部選中的checkbox的值了。

      分享:Apache中RewriteCond規則參數的詳細介紹
      Apache中 RewriteCond語句對于我來說一直是個難點,多次試圖去把它搞明白,都沒有結構,這次我終于算大概知道它的意思了 RewriteCond就像我們程序中的if語句一樣,表示如果符合某個或某幾個條件則執行RewriteCond下面緊鄰的RewriteRule語句,這就是RewriteCond最原始、

      來源:模板無憂//所屬分類:PHP教程/更新時間:2013-07-02
      相關PHP教程