file_exists() function returns true if it does, and false otherwise. : file_exists « File Directory « PHP






file_exists() function returns true if it does, and false otherwise.

 
Its syntax is: bool file_exists (string file)

<?
$filename = "data.txt";

if (! file_exists ($filename)) :
     print "File $filename does not exist!";
endif;
?>
  
  








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.The file_exists.php script checks to see whether the file is there