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;
精彩评论