0
我想在JSON查询中选择特定的对象。我对它进行了解码,尽管我花了几个小时寻找答案,但我无法为这个具体情况确定一个答案。我想从“博客”响应中选择URL,但是我无法越过数组。从JSON数组中取出对象
$oauth->fetch("http://api.tumblr.com/v2/user/info");
$json = json_decode($oauth->getLastResponse());
$url = $json->response->user->blogs;
$url1 = array($url->url); //This line doesn't give me the URL- I'm getting Array ([0] =>)
print_r($url1);
时,我没有在阵列器件的输出给了我:
Array ([0] => stdClass Object ([name] => 12748784 [url] => http://12748784.tumblr.com/ [followers] => 0 [primary] => 1 [title] => Untitled [description] => [admin] => 1 [updated] => 1341883193 [posts] => 1 [drafts] => 0 [messages] => 4 [queue] => 0 [ask] => 1 [ask_anon] => [tweet] => N [facebook] => N [facebook_opengraph_enabled] => N [type] => public)))))
感谢任何帮助,您可以给我。我因搜索而疲惫不堪。