Source Code : Creating a Function That Performs Multiple File Tests

PHP Is Open Source Programming Language You Can Download and use It, You required xampp server and wamp server . You download From xampp server from https://www.apachefriends.org/download.html. Click Here to download
We provide this code related to title for you to solve your developing problem easily. Libraries which is import in this program you can download from http://php.net/. Click Here or search from google with Libraries Name you get jar file related it and also http://php.net/ is a official site

Creating a Function That Performs Multiple File Tests

 
<?php
function outputFileTestInfo( $file ) {
  if ( ! file_exists( $file ) ) {
    print "$file does not exist<br/>";
    return;
  }
  print "$file is ".(    is_file( $file )?"":"not ")."a file<br/>";
  print "$file is ".(    is_dir( $file )?"":"not ")."a directory<br/>";
  print "$file is ".(  is_readable( $file )?"":"not ")."readable<br/>";
  print "$file is ".(  is_writable( $file )?"":"not ")."writable<br/>";
  print "$file is ".( is_executable( $file )?"":"not")."executable<br/>";
  print "$file is ".( filesize($file))." bytes<br/>";
  print "$file was accessed on " . date( "D d M Y g:i A", fileatime( $file ) )."<br/>";
  print "$file was modified on " . date( "D d M Y g:i A", filemtime( $file ) )."<br/>";
  print "$file was changed on  " . date( "D d M Y g:i A", filectime( $file ) )."<br/>";
}
?>
<html>
<head>
<title>Multiple File Tests</title>
</head>
<body>
<div>
<?php
outputFileTestInfo( "test.txt" );
?>
</div>
</body>
</html>
  
  

Thank with us