采用肿瘤透镜和以下代码:
$var = xhttp::toQueryArray($response[ body ]);
print_r($var);
这部插图如下:
Array ( [{"meta":{"status":200,"msg":"OK"},"response":{"user":{"name":"lukebream","likes":0,"following":8,"default_post_format":"html","blogs":[{"name":"lukebream","url":"http://lukebream.tumblr.com/","followers":5,"primary":true,"title":"Untitled","admin":true,"queue":0,"ask":false,"tweet":"N"}]}}}] => )
我如何能够接触各个要素,把它们归入变量?
这里是我完成的:
$tumblr->set_token($_SESSION[ oauth_token ], $_SESSION[ oauth_token_secret ]);
$data = array();
$data[ post ] = array();
$response = $tumblr->fetch( http://api.tumblr.com/v2/user/info , $data);
if($response[ successful ]) {
echo $response[ json ][ response ][ url ];
} else {
echo "api call failed. {$response[body]}<br><br>";
}