Check File Exist in Folder in PHP

Leave a Comment

You can test for the existence of a file with the file_exists() function.

This requires a string representing an absolute or relative path to a file that may or may not be there.

If the file is found, it returns true; otherwise, it returns false.
if ( file_exists("test.txt") )
  print "The file exists!";

0 comments:

Post a Comment