小编Dav*_*oni的帖子

尝试打印或回显数组中的数组

当我使用函数时,我有一个名为$ results的数组:

print_r($results);
Run Code Online (Sandbox Code Playgroud)

我得到以下内容.

Array
(
    [0] => ProfileElement Object
        (
            [name] => John thomson 
            [email] => johnt@gmail.com
            [Bio] => 20 years of engineering expertise
            [url] => http://twitter.com 
        )
)
Run Code Online (Sandbox Code Playgroud)

我的目标是分别回显[name] [email] [Bio] [url]值.但是当我在php中编写以下代码时,我没有得到任何值?

echo $results[0]["ProfileElement Objects"]["Bio"];
Run Code Online (Sandbox Code Playgroud)

有谁知道为什么?这不是数组中的数组吗?

php arrays

2
推荐指数
2
解决办法
101
查看次数

标签 统计

arrays ×1

php ×1