定义和用法
is_file() 函数检查指定的文件名是否是正常的文件
语法
is_file(file)
参数解析
| 参数 | 描述 |
|---|---|
| file | 必需。规定要检查的文件。 |
示例
<?php
$file = "test.txt";
if(is_file($file)){
echo ("$file is a regular file");
}else{
echo ("$file is not a regular file");
}
?>
输出
test.txt is a regular file
本文转自 素颜猪 51CTO博客,原文链接:http://blog.51cto.com/suyanzhu/1896174