Example
Check whether a file exists:
html
<?php
echo file_exists("webdictionary.txt");
?>
Definition and Usage
The file_exists() function checks whether a file or directory exists.
Note: The result of this function is cached. Use clearstatcache() to clear the cache.
Syntax
text
file_exists(path)
Parameter Values
| Parameter | Description |
|---|---|
| path | Required. Specifies the path to the file or directory to check |
Technical Details
| Return Value: | TRUE if the file or directory exists, FALSE on failure |
|---|---|
| PHP Version: | 4.0+ |