亚洲乱码中文字幕综合,中国熟女仑乱hd,亚洲精品乱拍国产一区二区三区,一本大道卡一卡二卡三乱码全集资源,又粗又黄又硬又爽的免费视频

php獲取$_POST同名參數(shù)數(shù)組的實(shí)現(xiàn)介紹

 更新時(shí)間:2013年06月30日 12:16:49   作者:  
本篇文章是對(duì)php獲取$_POST同名參數(shù)數(shù)組的實(shí)現(xiàn)方法進(jìn)行了詳細(xì)的分析介紹,需要的朋友參考下
今天寫php的時(shí)候發(fā)現(xiàn)$_POST["arr"]無法獲取參數(shù)arr的數(shù)組,記錄一下。
例如有以下表單需要提交:
復(fù)制代碼 代碼如下:

  <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"]只能獲得最后選擇的復(fù)選框的值,要獲得全部選中的復(fù)選框的值需要把表單修改成下面:
復(fù)制代碼 代碼如下:

  <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的值了。

相關(guān)文章

最新評(píng)論