我正在尝试在 JSON 查询中选择特定对象。我已经对其进行了解码,尽管我花了几个小时寻找答案,但我无法为这种特定情况确定一个答案。我想从博客响应中选择 URL,但是我无法通过数组。
$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 ) ) ) ) )
感谢你给与我的帮助。我因搜索而筋疲力尽。