【发布时间】:2017-07-06 06:41:32
【问题描述】:
我正在尝试从该数组中导航和获取信息,但我没有取得多大成功,有什么提示吗?这是来自 Twitter API 的解码 JSON
我尝试了echo $array->statuses[0]->created_at;,但它不起作用,我在这里做错了吗?
Array
(
[statuses] => Array
(
[0] => stdClass Object
(
[created_at] => Thu Jul 06 04:05:06 +0000 2017
[id] => 882812623959584768
[id_str] => 882812623959584768
[text] => RT @blackdragonsBR: [R6] GG!! Fechamos o mapa Banco por 5x2 e conquistamos a liderança no #ALIENWARENOIGN #GOBD #Acer #Predator https://t.c…
[truncated] =>
[entities] => stdClass Object
(
[hashtags] => Array
(
[0] => stdClass Object
(
[text] => ALIENWARENOIGN
[indices] => Array
(
[0] => 90
[1] => 105
}
)
}
}
}
}
}
【问题讨论】:
-
好吧,我想我明白了,
echo $array['statuses'][0]->created_at; -
只需在第一次访问时使用
[],例如:$array[statuses][0]->created_at;