PHP: Vérifier si le fichier est lisible

Author:
<html>
<head>
</head>
<body>
<?php
$file = "test.txt";
outputFileTestInfo( $file );
function outputFileTestInfo( $f ){
   if ( ! file_exists( $f ) ){
       print "$f Ce fichier n'existe pas<BR>";
      return;
   }
   print "$f ".(is_readable( $f )?"est ":" n'est pas ")."lisible<br>";
}
?>
</body>
</html>
 
           
       

Leave a Reply

Your email address will not be published. Required fields are marked *


3 × three =