The file_exists() function checks whether a file or directory exists.
Returns TRUE if the specified file or directory exists, otherwise returns FALSE.
file_exists(path)
| parameter | describe |
|---|---|
| path | Required. Specifies the path to be checked. |
<?phpecho file_exists("test.txt");?>The above code will output:
1