Current Location: Home> Function Categories> file_exists

file_exists

Check if the file or directory exists
Name:file_exists
Category:File system
Programming Language:php
One-line Description:Check if the file or directory exists.

Definition and usage

file_exists() function checks whether a file or directory exists.

Return true if the specified file or directory exists, otherwise return false.

Example

 <?php
echo file_exists ( "test.txt" ) ;
?>

Output:

 1

grammar

 file_exists ( path )
parameter Description
path Required. Specify the path to be checked.
Similar Functions
Popular Articles