0

我有一些 curl 代码,当我运行它并回显 $httpResponse = curl_exec($ch) 时,会打印以下内容。我将如何从中单独提取元素?

httpresponse{"access_token":"233408318.617bf98.6adcf10f06d04f8ca7d66ccb61a829ba","user":{"username":"jsniff","bio":"","website":"","profile_picture":"http:\/\/images.ak.instagram.com\/profiles\/anonymousUser.jpg","full_name":"","id":"233408318"}}   
4

1 回答 1

1

json_decode如果您解析出"httpresponse"领先的,将完成工作{

尝试:

print_r(json_decode(substr($httpResponse,12)));

您可以访问对象:

$responseObj=json_decode(substr($httpResponse,12));
echo $responseObj->user->username;
于 2013-06-07T22:47:02.910 回答