开发者

How to GET this value from JSON from Twitter API

Hey guys, feel stupid for asking this question but I'm stuck and new with getting values from JSON. In the JSON example of th开发者_如何学编程e statuses/mentions of the Twitter API: http://dev.twitter.com/doc/get/statuses/mentions

I'm trying to get the 'screen_name' value from with the 'user' directory/array piece (don't know the term). Heres what I'm using to pull values currently:

$lastmentions = $oauth->get('http://api.twitter.com/1/statuses/mentions.json');
$lastmentionsuser = $lastmentions[0]->user;

Thanks guys, Dex


This should work:

$screen_name = $lastmentionsuser->screen_name;


Woop Woop figured it! It was:

$lastmmentionsuser = $lastmmentions[$i]->user->screen_name;
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜