Tutorials Point


  Learning PHP
  Advanced PHP
  PHP Function Reference
  PHP Useful Resources
  Selected Reading

Copyright © 2014 by tutorialspoint



  Home     References     Discussion Forums     About TP  

PHP Function fileatime()


previous

Advertisements

Syntax

int fileatime ( string $filename );

Definition and Usage

Gets the last access time of the given file.

Paramters

ParameterDescription
filenamePath to the file.

Return Value

Returns the time the file was last accessed, or FALSE in case of an error. The time is returned as a Unix timestamp.

Example

Following is the usage of this function:

<?php
$filename = "/home/httpd/html/index.php";
if (file_exists($filename)) {
    echo "$filename was last accessed: " . 
          date("F d Y H:i:s.", fileatime($filename));
}
?>

previous Printer Friendly

Advertisements


  

Advertisements