Checking the existence of a file : file_exists « File Directory « PHP






Checking the existence of a file

 
if (file_exists('/usr/local/htdocs/index.html')) {
    print "Index file is there.";
} else {
    print "No index file in /usr/local/htdocs.";
}
  
  








Related examples in the same category

1.Checking Whether a File Exists
2.Checking for Existence with file_exists()
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