试图了解 Deezer API。
当我访问时:
我最终在 http://mydomain.me/?code=8b69a9a6137094814375bcd5aa9a6c02
我想code
从响应中解析变量。我怎样才能用 cURL 做到这一点?
这是我尝试过的:
$url = 'http://connect.deezer.com/oauth/auth.php?app_id=MY_APP_ID&redirect_uri=http://mydomain.me&perms=basic_access';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,$url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_HEADER, true);
$a = curl_exec($ch);
$a = curl_getinfo($ch, CURLINFO_EFFECTIVE_URL);
echo "<pre>";
var_dump($a);
die();