Currently Im trying to use elliots twitter library for CI at http://www.haughin.com/code/twitter/ after installation, it went well. the source code worked well..
Then I try to add code at index() function which is like this :
function index()
{
echo 'hi there';
$user = $this->tweet->call('get', 'account/verify_credentials');
$dec = json_decode($user);
}
I tried to decode json by using json_decode() function but it return error
json_decode() expects parameter 1 to be string, object given
This is my first time working with json..
Is there something I missed out ?
Thank you..
It doesn`t need any variable convertion.
just access object directly like $dec->username