I\'m using this code to get a token from Spotify\'s Web API:
You need to decode the JSON:
$response = json_decode($response, true);
Then you'll have an array with the values.
$token = $response['access_token'];
Also, you're missing a necessary option to obtain the response in this way:
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
If not defined, you will get a boolean value instead of the response.