English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

Basic PHP Tutorial

Advanced PHP Tutorial

PHP & MySQL

PHP Reference Manual

Usage and Examples of PHP is_readable() Function

PHP Filesystem Reference Manual

The is_readable() function can check if the specified file is readable. If the file is readable, this function returns true.

Syntax

bool is_readable ( string $filename )

This function can determine whether a file exists and is readable.

Online Example

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

Output Result

/PhpProject/php/phptest.txt is readable

PHP Filesystem Reference Manual