1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
| $opts = array(
'https'=>array(
'method'=>"GET",
'follow_location' => false,
'max_redirects' => 0,
'header'=>"Connection: keep-alive\r\n
Cache-Control: max-age=0\r\n
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8\r\n
User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/30.0.1599.66 Safari/537.36\r\n
Accept-Encoding: gzip,deflate,sdch\r\n
Accept-Language: fr,en-US;q=0.8,en;q=0.6\r\n ")
);
$url=trim($url);
$context = stream_context_create($opts);
if ($data = file_get_contents($url, false, $context)){
$r = $http_response_header;
print_r($r);
}else{
echo "Probleme d'ouverture de l'url\n";
$r = $http_response_header;
print_r($r);
} |
Partager