I have the following https:// url which contains a json array´
https://us.api.blizzard.com/data/wow/mount/6?namespace=static-us&locale=en_US&access_token=USgdNPkRDwpJ1m4zQ2mHokA0O12E0kPTih
I want to decode this json array in a php array.
For that I´ve used
$jsondata = file_get_contents('https://us.api.blizzard.com/data/wow/mount/6?namespace=static-us&locale=en_US&access_token=USgdNPkRDwpJ1m4zQ2mHokA0O12E0kPTih');
$data = json_decode($jsondata, true);
I tried a lot of solutions since it seems to be known that file_get_contents
can´t read out https urls.
Could you help me, how can I decode this json array in a php one so I can continue to work with it like it would be a "normal" php array?
I also tried this curl solution with no success:
$url="https://us.api.blizzard.com/data/wow/achievement/6?namespace=static-us&locale=en_US&access_token=USgdNPkRDwpJ1m4zQ2mHokA0O12E0kPTih";
function getSslPage($url) {
$ch = curl_init();
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_HEADER, false);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_REFERER, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
$result = curl_exec($ch);
curl_close($ch);
return $result;
}