开发者

Get POST variable that is an array

开发者 https://www.devze.com 2023-01-02 08:50 出处:网络
All, I have the following hidden variables: <input type=\"hidden\" name=\"chk[10]\" value = \"cats\">

All,

I have the following hidden variables:

<input type="hidden" name="chk[10]" value = "cats">
<input type="hidden" name="chk[13]开发者_开发技巧" value = "dogs">
<input type="hidden" name="chk[14]" value = "fish">

I want to get these variables through POST and print them. How can I do this in PHP?

Thanks


foreach($_POST['chk'] as $key => $value) {
    echo $key, ' => ', $value, '<br />';
}


$chks = $_POST["chk"];
print_r($chks);
0

精彩评论

暂无评论...
验证码 换一张
取 消