当前位置: 首页> 函数类别大全> is_readable

is_readable

判断文件是否存在且可读
名称:is_readable
分类:文件系统
所属语言:php
一句话介绍:判断文件是否可读。

定义和用法

is_readable() 函数判断指定文件名是否可读。

实例

<?php
$file = "test.txt";
if(is_readable($file))
  {
  echo ("$file is readable");
  }
else
  {
  echo ("$file is not readable");
  }
?>

输出:

test.txt is readable

语法

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

说明

如果由 file 指定的文件或目录存在并且可读,则返回 TRUE。

同类函数
  • 读取文件(可安全用于二进制文件)  fread

    fread

    读取文件(可安全用于二进制文件)
  • 参见 unlink() 或 unset()(PHP 没有 delete 关键词或函数)  delete

    delete

    参见unlink()或unset()(P
  • 将上传的文件移动到新位置  move_uploaded_file

    move_uploaded_file

    将上传的文件移动到新位置
  • 获取文件权限  fileperms

    fileperms

    获取文件权限
  • 返回规范化的绝对路径名  realpath

    realpath

    返回规范化的绝对路径名
  • 清除文件状态缓存  clearstatcache

    clearstatcache

    清除文件状态缓存
  • 获取文件修改时间  filemtime

    filemtime

    获取文件修改时间
  • is_writable 的别名  is_writeable

    is_writeable

    is_writable的别名
热门文章