PHP file_exists() Function
Definition and Usage
The file_exists() function checks if a file or directory exists.
Returns true if the specified file or directory exists, otherwise returns false.
Syntax
file_exists(path)
Parameter | Description |
---|---|
path | Required. Specifies the path to be checked. |
Example
<?php echo file_exists("test.txt"); ?>
Output:
1