贴出出错这部分的代码($code是上一步获取到的):
$uri='
https://www.douban.com/service/auth2/token'; $data=array(
'client_id'=>APIKEY,
'client_secret'=>SECRET,
'redirect_uri'=>CALLBACK,
'grant_type'=>'authorization_code',
'code'=>$code
);
$ch = curl_init ();
curl_setopt ( $ch, CURLOPT_URL, $uri );
curl_setopt ( $ch, CURLOPT_POST, 1 );
curl_setopt ( $ch, CURLOPT_HEADER, 0 );
curl_setopt ( $ch, CURLOPT_RETURNTRANSFER, 1 );
curl_setopt ( $ch, CURLOPT_POSTFIELDS, $data );
$json = curl_exec ( $ch );
curl_close ( $ch );