Php/func filesystem file exists
来自菜鸟教程
PHP file_exists()函数
例
检查文件是否存在:
<?php
echo file_exists("test.txt");
?>
定义和用法
file_exists()函数检查文件或目录是否存在。
注意: 此功能的结果被缓存。Use clearstatcache()
清除缓存。
句法
file_exists(path)
参数值
| 参数 | 描述 |
|---|---|
| path | 需要。指定要检查的文件或目录的路径 |
技术细节
| 返回值: | 如果文件或目录存在,则为TRUE,失败时为FALSE |
| PHP版本: | 4.0+ |