$url = 'https://soccer365.ru/games/921770/';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_USERAGENT, "GOOGLE"); // Обманочка
curl_setopt($ch, CURLOPT_HEADER, 0);
$output = curl_exec($ch);
curl_close($ch);
echo $output;
$url = 'https://soccer365.ru/';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_USERAGENT, "GOOGLE"); // Обманочка
curl_setopt($ch, CURLOPT_HEADER, 0);
$output = curl_exec($ch);
curl_close($ch);
echo $output;
$context = stream_context_create(
[
'http' => [
'method' => 'GET',
'header' => "path: /games/921770/\r\n" .
"User-agent: Mozilla/5.0 (Linux; Android 4.4.4; HM NOTE 1LTEW Build/KTU84P) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/33.0.0.0 Mobile Safari/537.36 MicroMessenger/6.0.0.54_r849063.501 NetType/WIFI\r\n",
'ignore_errors' => true,
],
]
);
$request = file_get_contents(
'https://soccer365.ru/games/921770/',
false,
$context
);
die(print_r($request));
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_USERAGENT, "GOOGLE"); // Обманочка
curl_setopt($ch, CURLOPT_HEADER, 0);
$output = curl_exec($ch);
echo '<pre>';
print_r( curl_getinfo($ch) );
echo '</pre>';
curl_close($ch);
echo $output;
Array
(
[url] => https://soccer365.ru/games/921770/
[content_type] => text/html; charset=UTF-8
[http_code] => 301
[header_size] => 539
[request_size] => 84
[filetime] => -1
[ssl_verify_result] => 0
[redirect_count] => 0
[total_time] => 0.255368
[namelookup_time] => 0.000614
[connect_time] => 0.02999
[pretransfer_time] => 0.19802
[size_upload] => 0
[size_download] => 0
[speed_download] => 0
[speed_upload] => 0
[download_content_length] => 0
[upload_content_length] => 0
[starttransfer_time] => 0.25531
[redirect_time] => 0
[redirect_url] => https://soccer365.ru//soccer365.ru/live/match-etyir-1924-levski-smotret-onlayn/
[primary_ip] => 51.15.25.134
[certinfo] => Array
(
)
)