| 参数 | 描述 |
|---|---|
| file | 必需。规定要检查的文件。 |
如果文件名存在并且为目录,则返回 true。如果 file 是一个相对路径,则按照当前工作目录检查其相对路径。
注释:本函数的结果会被缓存。请使用 clearstatcache() 来清除缓存。
<?php
$file = "images";
if(is_dir($file))
{
echo ("$file is a directory");
}
else
{
echo ("$file is not a directory");
}
?>
输出:
images is a directory
|
制作:
http://www.7di.net 生活网搜集整理 参考: http://www.w3school.com.cn/php/func_filesystem_is_dir.asp |