Home Menu

fileatime

Gets last access time of file

Syntax

fileatime ( string $filename ) : int

Parameters

filename

Path to the file.

Return

Returns the time the file was last accessed, or FALSE on failure. The time is returned as a Unix timestamp.

Examples

1

<?

$filename = $_SERVER["DOCUMENT_ROOT"] . "/assets/txt/file.txt";

$return = fileatime($filename);

echo $return;

?>
1627086263

2

<?

$filename = $_SERVER["DOCUMENT_ROOT"] . "/assets/txt/file.txt";

$return = fileatime($filename);

echo "last accessed: " . date("Y-m-d H:i:s", $return);

?>
last accessed: 2021-07-24 00:24:23

Internal

filectime

filemtime

External

PHP

JesusBible
HTMLCSSJSPHPSVGMore
AboutTerms