gpt4 book ai didi

php - 获取作为数组的 POST 变量

转载 作者:塔克拉玛干 更新时间:2023-11-03 06:02:01 25 4
gpt4 key购买 nike

全部,

我有以下隐藏变量:

<input type="hidden" name="chk[10]" value = "cats">
<input type="hidden" name="chk[13]" value = "dogs">
<input type="hidden" name="chk[14]" value = "fish">

我想通过POST获取这些变量并打印出来。我如何在 PHP 中执行此操作?

谢谢

最佳答案

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

关于php - 获取作为数组的 POST 变量,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2990990/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com