PHP 教程 PHP 表单 PHP 高级教程 PHP 数据库 PHP XML PHP 与 AJAX PHP 参考手册

发布于 2016-11-18 14:33:24 | 66 次阅读 | 评论: 0 | 来源: 网络整理


定义和用法

is_file() 函数检查指定的文件是否是常规的文件。

如果文件是常规的文件,该函数返回 TRUE。

语法

 is_file(file) 

参数描述
file必需。规定要检查的文件。


提示和注释

注释:该函数的结果会被缓存。请使用 clearstatcache() 来清除缓存。


实例

 <?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 


最新网友评论  共有(0)条评论 发布评论 返回顶部

Copyright © 2007-2017 PHPERZ.COM All Rights Reserved   冀ICP备14009818号  版权声明  广告服务