Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/258.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/arrays/12.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 - Fatal编程技术网

Php 获取数组数据

Php 获取数组数据,php,arrays,Php,Arrays,以下是使用r\u print打印的配置文件数组: Array ( [0] => Array ( [Title] => Profile [Name] => Veritas [NKey] => Key_1 [SKey] => Key_2 ) [1] => Array ( [Titl

以下是使用
r\u print
打印的配置文件数组:

Array
(
    [0] => Array
        (
            [Title] => Profile
            [Name] => Veritas
            [NKey] => Key_1
            [SKey] => Key_2
        )

    [1] => Array
        (
            [Title] => Access
            [Admin] => True
            [Banned] => False
            [Public] => True
        )

)
我所要做的只是检索数组的元素

出于某种原因,上面的代码不起作用,尽管从逻辑上讲,它应该可以正常工作。
如果我以数组中的任何对象为目标,则返回的仅为字符“A”。

通过将数组分配给
$profile[]
将为数组添加另一个级别。括号将
$profile
转换为一个数组,然后将该数组添加到该数组中,从而产生额外的级别

$profile[] = ...; //GET_ARRAY
应该是

$profile = ...; //GET_ARRAY

我知道我在寻找什么,认为PHP自动格式化了从另一个页面传递的数组(字符串数据)。我使用serialize()和unserialize()解决了我的问题。

感谢这一技巧,尽管即使删除了维度,我似乎仍然无法从任何元素访问数据。
$profile = ...; //GET_ARRAY