PHP is_dir() 函数
PHP 教程
· 2019-01-25 09:59:48
定义和用法
is_dir() 函数检查指定的文件是否是一个目录。
如果目录存在,该函数返回 TRUE。
语法
is_dir(file)
| 参数 | 描述 |
|---|---|
| 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
点击查看所有 PHP 教程 文章: https://codercto.com/courses/l/5.html
Programming Ruby
Dave Thomas、Chad Fowler、Andy Hunt / Pragmatic Bookshelf / 2004-10-8 / USD 44.95
Ruby is an increasingly popular, fully object-oriented dynamic programming language, hailed by many practitioners as the finest and most useful language available today. When Ruby first burst onto the......一起来看看 《Programming Ruby》 这本书的介绍吧!