PHP file_exists () function
Definition and Usage
file_exists () function checks the file or directory exists.
If the specified file or directory exists returns TRUE, otherwise it returns FALSE.
grammar
file_exists(path)
参数 | 描述 |
---|---|
path | 必需。规定要检查的路径。 |
Examples
<?php
echo file_exists("test.txt");
?>
echo file_exists("test.txt");
?>
The code above will output:
1
Complete PHP Filesystem Reference Manual