I am checking if there is an image to show it if it does not exist, that it shows a default image. To prove it I have tried the following:
$imagen = 'http://'.$_SERVER['SERVER_NAME'].'/assets/img/'.$infoUsuario["USCOD"].'.png';
echo $imagen;
if(file_exists($imagen)){
echo "EXISTE";
}else{
echo "NO EXISTE";
}
It returns me whenever it does not exist, but if I put the route (the one shown in echo $imagen
) in the browser it shows me the image correctly.