• PHP Video Tutorials

PHP - Function is_readable()



The is_readable() function can check whether the specified file is readable. This function can return true if the file is readable.

Syntax

bool is_readable ( string $filename )

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

Example

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

Output

/PhpProject/php/phptest.txt is readable
php_function_reference.htm
Advertisements