Check whether a file exists:
<?php
echo file_exists("test.txt");
?>
Run Example »
Run Example »
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.
file_exists(
path)
Parameter | Description |
---|---|
path | Required. Specifies the path to the file or directory to check |
Return Value: | TRUE if the file or directory exists, FALSE on failure |
---|---|
PHP Version: | 4.0+ |
截取页面反馈部分,让我们更快修复内容!也可以直接跳过填写反馈内容!