Checking Whether a File Exists : file_exists « File Directory « PHP






Checking Whether a File Exists

 
<?
    if (file_exists("snapshot1.png")) {
            print "Snapshot1.png exists!\n";
    } else {
            print "Snapshot1.png does not exist!\n";
    }
?>
  
  








Related examples in the same category

1.Checking for Existence with file_exists()
2.Checking the existence of a file
3.file_exists() function returns true if it does, and false otherwise.
4.The file_exists.php script checks to see whether the file is there