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

filectime

Description

The filectime of Filesystem for PHP gets inode change time of file.

Syntax

filectime(
    string $filename
): int|false

Parameters

filename

Path to the file.

Return

Returns the time the file was last changed, 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 = filectime($filename);

echo $return;

?>
1721704042

2 · date

<?

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

$return = filectime($filename);

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

?>
last changed: 2024-07-23 03:07:22
HomeMenu