PHP file_exists() 函数

定义和用法

file_exists() 函数检查文件或目录是否存在。

如果指定的文件或目录存在则返回 true,否则返回 false。

语法

file_exists(path)
参数描述
path 必需。规定要检查的路径。

 

 

 

<?php
echo file_exists("test.txt");
?>

输出:

1
posted @ 2013-10-24 23:50  无忧之路  阅读(520)  评论(0编辑  收藏  举报
无忧之路