Hello i have never worked with curls in php before, i am trying to get the curl output that i also get when using it in the command line.
Here is what i have tried
$url = 'curl -X "GET" "https://api.spotify.com/v1/me/top/artists" -H "Accept: application/json" -H "Content-Type: application/json" -H "Authorization: MY KEY HERE"';
$ch = curl_init();
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_URL,$url);
$result=curl_exec($ch);
curl_close($ch);
var_dump(json_decode($result, true));
$result = file_get_contents($url);
var_dump(json_decode($result, true));
Those two var_dumps
both get me the output NULL
.
I am aware that my url is not correct, but i am not sure waht to change.