PHP is_file() 函数

PHP 教程 · 2019-01-25 10:29:16

定义和用法

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


点击查看所有 PHP 教程 文章: https://codercto.com/courses/l/5.html

查看所有标签

The Information

The Information

James Gleick / Vintage / 2012-3-6 / USD 16.95

James Gleick, the author of the best sellers Chaos and Genius, now brings us a work just as astonishing and masterly: a revelatory chronicle and meditation that shows how information has become th......一起来看看 《The Information》 这本书的介绍吧!

随机密码生成器
随机密码生成器

多种字符组合密码

RGB HSV 转换
RGB HSV 转换

RGB HSV 互转工具