$user_agent = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/601.7.8 (KHTML, like Gecko) Version/9.1.3 Safari/601.7.8';
$headers = array();
$headers[] = 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8';
$headers[] = 'Accept-Encoding: gzip, deflate';
$headers[] = 'Accept-Language: ru';
$headers[] = 'Cache-Control: max-age=0';
$headers[] = 'User-Agent: '. $user_agent;
$ch = curl_init();
curl_setopt_array($ch, array(
CURLOPT_RETURNTRANSFER => true,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTPHEADER => $headers,
CURLOPT_URL => 'https://goldroyal.net/',
CURLOPT_USERAGENT => $user_agent,
CURLOPT_SSL_VERIFYPEER => false,
CURLOPT_SSL_VERIFYHOST => false
));
$ch_res = curl_exec($ch);
if (!$ch_res) {
echo "Error: ".curl_error($ch);
exit();
}
Получаю ошибку: