当前位置: 首页> 函数类别大全> 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。

同类函数
  • 倒回文件指针的位置  rewind

    rewind

    倒回文件指针的位置
  • 清除文件状态缓存  clearstatcache

    clearstatcache

    清除文件状态缓存
  • 重命名文件或目录  rename

    rename

    重命名文件或目录
  • 更改当前的 umask  umask

    umask

    更改当前的umask
  • 判断给定文件名是否是一个目录  is_dir

    is_dir

    判断给定文件名是否是一个目录
  • 写入文件(可安全用于二进制文件)  fwrite

    fwrite

    写入文件(可安全用于二进制文件)
  • disk_free_space 的别名  diskfreespace

    diskfreespace

    disk_free_space的别名
  • 建立一个硬连接  link

    link

    建立一个硬连接
热门文章