fetch data from an object

前端 未结 2 1647
粉色の甜心
粉色の甜心 2021-01-28 07:16

I am trying to fetch data from user\'s twitter account with this code

$user_info = $twitteroauth->get(\'account/verify_credentials\');

i get

2条回答
  •  日久生厌
    2021-01-28 08:01

    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.

提交回复
热议问题