if (file_exists($dir) || file_exists($file) && $a < 5) { echo "Файл или папка есть!"; }else{ echo "Файла или папки нет!"; }