$filename = '/images/'.$noticia['folder1'].'/'.$noticia['filename']; if (!file_exists($filename)) { echo "The file $filename DOES exist"; } else { echo "The file $filename does not exist"; }