Chinaunix首页 | 论坛 | 博客
  • 博客访问: 402614
  • 博文数量: 95
  • 博客积分: 5001
  • 博客等级: 大校
  • 技术积分: 1030
  • 用 户 组: 普通用户
  • 注册时间: 2007-05-13 11:43
文章分类

全部博文(95)

文章存档

2007年(95)

我的朋友

分类:

2007-05-26 01:30:41

file_exists -- 检查文件或目录是否存在

说明

bool file_exists ( string filename)

如果由 filename 指定的文件或目录存在则返回 TRUE,否则返回 FALSE

在 Windows 中要用 //computername/share/filename 或者 \\computername\share\filename 来检查网络中的共享文件。

例子 1. 测试一个文件是否存在

$filename = '/path/to/foo.txt';

if (
file_exists($filename
)) {
    print
"The file $filename exists"
;
} else {
    print
"The file $filename does not exist"
;
}
?>

注: 本函数的结果会被缓存。详细信息参见 。

注: 本函数不能作用于,被检查的文件必须通过服务器的文件系统访问。

阅读(744) | 评论(0) | 转发(0) |
0

上一篇:move_uploaded_file

下一篇:关于编程

给主人留下些什么吧!~~