Im really new in json code, even javascript code but I got this so far. I'm able to get json data from a local file with the same information but not from this external URL: https://s3.amazonaws.com/dolartoday/data.json
This is my code:
<?php
$json = file_get_contents("https://s3.amazonaws.com/dolartoday/data.json", 'jsonp');
$data = json_decode($json, true);
echo $data['USD']['dolartoday'];
?>
Expected result, something like this: 6124.24
Note: this code is ok, I get data from a local file with the same values but I cant fetch json data from this external URL specifically. I also added 'jsonp' but that didnt work.