Effectivement c'est le but puisque je teste afin de savoir si ca rend un NOT FOUND ou pas
Mais pourquoi ca marche pour une page et pas l'autre comme dans mon exemple fourni:
http://tripday.fr/sortie/sortir-avignon.html ( ça marche )
http://tripday.fr/sortie/sortir-voiron.html ( ça marche pas )
Le code est le même pour les 2 pages ...
J'ai fait un var_dump de $url_inextante et j'obtiens donc par exemple :
array (size=11)
0 => string 'HTTP/1.1 404 Not Found' (length=22)
'Server' => string 'nginx/1.2.3' (length=11)
'Date' => string 'Fri, 12 May 2017 17:04:59 GMT' (length=29)
'Content-Type' => string 'text/html; charset=iso-8859-1' (length=29)
'Content-Length' => string '234' (length=3)
'Connection' => string 'close' (length=5)
'Accept-Ranges' => string 'bytes' (length=5)
'X-Varnish' => string '2728308185 2728306629' (length=21)
'Age' => string '51' (length=2)
'Via' => string '1.1 varnish' (length=11)
'X-Varnish-Cache' => string 'HIT' (length=3)
Pour rapel j'ai ce problème que en ligne pas en local
Edit:
J'ai testé ceci mais pareil :
if (!empty($ligne['photo']) && file_exists('annonce/img-big-format/miniature/'.$ligne['photo'])) {
$image = '../annonce/img-big-format/miniature/'.$ligne['photo'];
// Si l'image renvoyé est une 404
}elseif (preg_match("#Not Found#i", $url_inexistante[0])) {
$ligne['photo'] = 'http://monsite.fr/annonce/img-big-format/defaut.jpg';
}else{
$image = '../annonce/remplacement/'.simplification($aLoisirs[$ligne['id_type_loisirs']]).'.jpg';
}
Le lien qui génére la 404 du coup:https://static.ticketmaster.fr/static/i ... 398186.gif