- get_headers: documentation ( source)
<?php
$lien = "http://www.hatshowroom.com/chapeaux/8-feutre-monkey-noir-3000008353259.html";
if(urlExist($lien) === FALSE){
echo 'KO';
} else {
echo "Goog";
}
function urlExist($url) {
$file_headers = @get_headers($url);
if($file_headers[0] == 'HTTP/1.1 404 Not Found'){
return false;
} else {
return true;
}
}