php is_dir()函数介绍
is_dir — 判断给定文件名是否是一个目录
语法:
bool is_dir ( string $filename )
判断给定文件名是否是一个目录。
参数:
- filename 如果文件名存在并且为目录则返回 TRUE。如果 filename 是一个相对路径,则按照当前工作目录检查其相对路径。 If filename is a symbolic or hard then the will be resolved and checked. If you have enabled 安全模式, or open_ dir further restrictions may apply.
返回值:
如果文件名存在,并且是个目录,返回 TRUE,否则返回FALSE。
php is_dir()实例
使用is_dir()函数判断是否为目录
is_dir() function verifies that the file is a directory
bool is_dir (string filename)
<?
$isdir = is_dir(\"index.html\"); // returns false
/* http://www.manongjc.com/article/1366.html */
$isdir = is_dir(\"book\"); // returns true
?> 继续阅读与本文标签相同的文章
上一篇 :
php源码之判断文件是否存在的两种方法
-
有人说,大数据和人工智能是未来的发展方向,对此你怎么看待?
2026-05-14栏目: 教程
-
谷歌宣布Daydream VR头显终止支持 以失败收场
2026-05-14栏目: 教程
-
微软正在测试面向Windows 10 1903的重要补丁
2026-05-14栏目: 教程
-
这款游戏曾被称为国产之光,现沦为“骗玩家充值”游戏,网友:再见
2026-05-14栏目: 教程
-
金属3D打印专家铂力特2019用户大会尽显大国实力
2026-05-14栏目: 教程
