Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/263.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 带数组的post中未定义的偏移量_Php_Arrays_Post - Fatal编程技术网

Php 带数组的post中未定义的偏移量

Php 带数组的post中未定义的偏移量,php,arrays,post,Php,Arrays,Post,我已经为这件事挣扎了两天,我需要帮助,哈哈。 我试图处理一个post,它有一些作为数组的输入 为了理解数组的结构,这里有一个print\r($\u POST) 打印($\u POST): 如果我打印($\u POST[“p”]),这就是我得到的结果(如预期的那样): 但是,如果我尝试进一步使用print_r($_POST[“p”][0]),我会收到: Notice: Undefined offset: 0 或打印($_POST[“p”][“1545”])也会因未定义的偏移量而失败 如何使$_P

我已经为这件事挣扎了两天,我需要帮助,哈哈。 我试图处理一个post,它有一些作为数组的输入

为了理解数组的结构,这里有一个print\r($\u POST)

打印($\u POST):

如果我打印($\u POST[“p”]),这就是我得到的结果(如预期的那样):

但是,如果我尝试进一步使用print_r($_POST[“p”][0]),我会收到:

Notice: Undefined offset: 0
或打印($_POST[“p”][“1545”])也会因未定义的偏移量而失败

如何使$_POST[“p”][“1545”]不返回未定义的内容

谢谢

试试这个

print_r($_POST["p"]["1545"][0])

尝试使用
获取
1545

print_r($_POST["p"]["'1545'"]);
似乎
'1545'
是数组
$\u POST['p']

这意味着您的HTML中有错误


$\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\两者都给出了未定义的偏移量:1545@monxas检查答案:未定义索引:1545如果1545不存在,则不会存在更多嵌套键
print_r($_POST["p"]["1545"][0])
print_r($_POST["p"]["'1545'"]);