Jesus · Bible · HTML · CSS · JS · PHP · SVG · Applications

fileatime

Description

The fileatime of Filesystem for PHP gets last access time of file.

Syntax

fileatime(
    string $filename
): int|false

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, which is suitable for the date() function.

Examples

1 · filename

<?

$filename = $_SERVER['DOCUMENT_ROOT'] . '/assets/txt/1.txt';

$return = fileatime($filename);

echo $return;

?>
1708618679

2 · date

<?

$filename = $_SERVER['DOCUMENT_ROOT'] . '/assets/txt/1.txt';

$return = fileatime($filename);

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

?>
last accessed: 2024-02-22 16:17:59
HomeMenu