如何在php中使用curl返回和格式化数组


How to return and format an array in php by using curl

我知道这可能是一个简单的问题,但我仍然卡在这里。

我正在调用一个API,这是我的代码:

   $access_token = 'asdfasdfasdfasdf';
   $uid = '12345678';
   $url = 'https://api.asd.com/2/statuses/user_timeline/ids.json?uid='.$uid.'&access_token='.$access_token.'&count=5';
   $ch = curl_init();
   curl_setopt($ch,CURLOPT_HEADER,false);
   curl_setopt($ch,CURLOPT_URL,$url);
   curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);
   $content=curl_exec($ch);
   curl_close($ch);
   echo $content;

这是我得到的:

{
    "statuses":"4023805771256802","4023694609717194","4021770053107357","4021769599890997","4021769217975680"],
    "marks":[],
    "hasvisible":false,
    "previous_cursor":0,
    "next_cursor":0,
    "total_number":94,
    "interval":0,
    "uve_blank":0
}

我想要的是只有一个'状态'数组,因为我只想使用'状态'中的数据。

谁能给我点提示?

这是JSON数据…使用json_decode()转换为数组

$arr = json_decode($content, TRUE);
$statuses = $arr['statuses'];