我有一个关于制造2D JSON stringPHP JSON解码 - stdClass的
现在我想知道为什么我不能访问以下问题:
$json_str = '{"urls":["http://example.com/001.jpg","http://example.com/003.jpg","http://example.com/002.jpg"],"alts":["testing int chars àèéìòóù stop","second description",""],"favs":["true", "false", "false"]}';
$j_string_decoded = json_decode($json_str);
// echo print_r($j_string_decoded); // OK
// test get url from second item
echo j_string_decoded['urls'][1];
// Fatal error: Cannot use object of type stdClass as array
很棒的答案,欢呼声Sarfraz – FFish 2010-11-02 18:55:06
@FFISH:欢迎:) – Sarfraz 2010-11-02 18:56:42