is_readable() function checks the readability of both a file and a directory. : is_readable « File Directory « PHP






is_readable() function checks the readability of both a file and a directory.

 
Its syntax is: bool is_readable (string filename)

<?
$filename="data.txt";

if ( is_readable($filename) ) :
     $fh = fopen($filename, "r");
else :
     print "$filename Is not readable!";
endif;
?>
  
  








Related examples in the same category

1.is_readable
2.is_readable() tells you whether you can read a file.