我发送以下代码中的网址
$checkboxes = http_build_query($checkbox);
echo "<script> document.location.href='index.php?act=magento&checkboxes=".$checkboxes."';</script>";
我收到以下网址
http://localhost/importcsvproduct/index.php?act=magento&checkboxes=0=15&1=16&2=17&3=18&4=19&5=20&6=21&7=22&8=23&9=24
我的问题是如何接收以上复选框数组?
我的数组$复选框的输出位于
之下Array
(
[0] => 15
[1] => 16
[2] => 17
[3] => 18
[4] => 19
[5] => 20
[6] => 21
[7] => 22
[8] => 23
[9] => 24
)
答案 0 :(得分:0)
请尝试以下方法:
$checkbox = array(4,5,6,7,8); // Does your array look like this?
$checkboxes = http_build_query(array('checkboxes' => $checkbox));
echo "<script> document.location.href='index.php?act=magento&checkboxes=".$checkboxes."';</script>";
您应该可以使用$_GET['checkboxes']
:
$_GET['checkboxes'][0]
$_GET['checkboxes'][1]
...