1С-Битрикс
- 47 ответов
- 0 вопросов
24
Вклад в тег
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);
var keys = Object.keys(arCartElements);
keys.forEach(function(elementId) {
var element = arCartElements[elementId];
console.log(element);
});
$sXmlData = xmlwriter_output_memory($xw);
$sFilename = 'Test';
header('Content-Type: application/octet-stream');
header('Content-Disposition: attachment; filename="' . $sFilename . '.xml"');
header('Content-Length: ' . mb_strlen($sXmlData, '8bit'));
echo $sXmlData;