The file_exists.php script checks to see whether the file is there : file_exists « File Directory « PHP






The file_exists.php script checks to see whether the file is there

 
<?php
$file_name="file_exists.php";

if(file_exists($file_name)) {
    echo ("$file_name does exist.");
}
else {
    echo ("$file_name does not exist.");
}
?>
  
  








Related examples in the same category

1.Checking Whether a File Exists
2.Checking for Existence with file_exists()
3.Checking the existence of a file
4.file_exists() function returns true if it does, and false otherwise.