PHP is_readable() 函数

PHP 教程 · 2019-01-25 10:56:50

定义和用法

is_readable() 函数检查指定的文件是否可读。

如果文件可读,该函数返回 TRUE。

语法


is_readable(file)


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

提示和注释

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

实例


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

上面的代码将输出:


test.txt is readable


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

查看所有标签

The Art of UNIX Programming

The Art of UNIX Programming

Eric S. Raymond / Addison-Wesley / 2003-10-3 / USD 54.99

Writing better software: 30 years of UNIX development wisdom In this book, five years in the making, the author encapsulates three decades of unwritten, hard-won software engineering wisdom. Raymond b......一起来看看 《The Art of UNIX Programming》 这本书的介绍吧!

JS 压缩/解压工具
JS 压缩/解压工具

在线压缩/解压 JS 代码

HEX HSV 转换工具
HEX HSV 转换工具

HEX HSV 互换工具