http://www.jb51.net/article/54431.htm
解决办法如下:
form表单的部分代码如下:
1
2
3
4
5
|
< input
type = "checkbox"
name = "frm_tag[]"
value = "1" >1 < input
type = "checkbox"
name = "frm_tag[]"
value = "2" >2 < input
type = "checkbox"
name = "frm_tag[]"
value = "3" >3 < input
type = "checkbox"
name = "frm_tag[]"
value = "4" >4 < input
type = "checkbox"
name = "frm_tag[]"
value = "5" >5 |
php处理POST传递过来数据的代码如下:
1
2
3
4
5
6
7
8
9
10
11
|
$str_tag
= "" ; $frm_tag
= $_POST [ 'frm_tag' ]; for ( $i =0; $i < count ( $frm_tag ); $i ++){ echo
$frm_tag [ $i ]. "<br>" ; if ( $i ==0) $str_tag
= $frm_tag [ $i ]; else $str_tag
= $str_tag . "," . $frm_tag [ $i ]; } echo
$str_tag ; } |