I am trying to fetch data from user\'s twitter account with this code
$user_info = $twitteroauth->get(\'account/verify_credentials\');
i get
The information is not an array
, but an object
. You can access the data by the following:
$info = $user_info->description;
You can repeat this by to go further down the chain such as:
$user_info->entities->description
, etc.
You are trying to access a object with the array index syntax it will not work this way.
When you are dealing with objects you need to access the array by using "->"
$user_info->name;
$user_info->entities->description;
$user_info->entities->description->urls;
This is the pattern to access to the depth