gpt4 book ai didi

php - 在 PHP 中获取名称中带有点的 $Post

转载 作者:塔克拉玛干 更新时间:2023-11-03 05:55:45 24 4
gpt4 key购买 nike

这应该是 PHP 中的一个非常基本的问题,但我在 web 中找不到很好的解决方案。请一些专家用例子告诉我。

我正在尝试读取 3 个文本框的值,这些名称是 input_38.1、input_38.2、input_38.3

所以我的代码是 echo $_POST['input_38.1']。但它不打印第一个文本框的值。获取所有三个文本框的值的方法是什么。

提前致谢。

最佳答案

I am trying to read value of 3 textboxes, those names are input_38.1, input_38.2, input_38.3

来自PHP Manual :

Dots and spaces in variable names are converted to underscores. For example <input name="a.b" /> becomes $_REQUEST["a_b"].

所以,你需要写:

echo $_POST['input_38_1'];

为避免混淆,最好不要在表单的名称属性中使用点。

关于php - 在 PHP 中获取名称中带有点的 $Post,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20575426/

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