features[0]->geometry->coordinates); curl_close($curl); $curl = curl_init(); curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); // curl_setopt($curl, CURLOPT_POST, 1); // curl_setopt($curl, CURLOPT_CUSTOMREQUEST, "PUT"); curl_setopt($curl, CURLOPT_CUSTOMREQUEST, "POST"); $data['grant_type'] = 'client_credentials'; curl_setopt($curl, CURLOPT_POSTFIELDS, $data); curl_setopt($curl, CURLOPT_URL, 'https://accounts.spotify.com/api/token'); $headers = array( 'Authorization' => `Basic 1111111111111111111111111111111111`, 'Content-Type' => 'application/x-www-form-urlencoded' ); curl_setopt($curl, CURLOPT_HTTPHEADER, $headers); $response_json = curl_exec($curl); print_r($response_json); //$response_php = json_decode($response_json); //print_r($response_php->features[0]->geometry->coordinates); curl_close($curl);