Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/252.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 从数组获取值时遇到问题注意:未定义索引:_Php_Arrays_Wordpress - Fatal编程技术网

Php 从数组获取值时遇到问题注意:未定义索引:

Php 从数组获取值时遇到问题注意:未定义索引:,php,arrays,wordpress,Php,Arrays,Wordpress,我试图使用以下命令将post_id设置为变量,但得到一个未定义的索引错误 $propertyID['post_id'] 这是我的var_dump() 您必须使用数组的索引0中的所有值:- $propertyID[0]['post_id'] //result :- 4323 $propertyID[0]['meta_key'] //result :- unique_id 使用$propertyID[0]['post_id'] $propertyID[0]['post_id'] //result

我试图使用以下命令将post_id设置为变量,但得到一个未定义的索引错误

$propertyID['post_id']
这是我的var_dump()


您必须使用数组的索引0中的所有值:-

$propertyID[0]['post_id'] //result :- 4323
$propertyID[0]['meta_key'] //result :- unique_id
使用$propertyID[0]['post_id']
$propertyID[0]['post_id'] //result :- 4323
$propertyID[0]['meta_key'] //result :- unique_id