function curlRequest($url)
{
$myCurl = curl_init();
curl_setopt_array($myCurl, array(
CURLOPT_URL => $url,
CURLOPT_SSL_VERIFYPEER => false,
CURLOPT_SSL_VERIFYHOST => false,
CURLOPT_RETURNTRANSFER => true,
));
$response = curl_exec($myCurl);
curl_close($myCurl);
return $response;
}
$url = 'http://www.cbr-xml-daily.ru/daily_json.js';
$contents = curlRequest($url);
$data = json_decode($contents, true);
var_dump($data);