PHP filemtime() Function

❮ PHP Filesystem Reference

Example

Get the last time the file content was modified:

<?php
echo filemtime("webdictionary.txt");
echo "<br>";
echo "Content last changed: ".date("F d Y H:i:s.", filemtime("webdictionary.txt"));
?>
Run Example »

Definition and Usage

The filemtime() function returns the last time the file content was modified.

Note: The result of this function is cached. Use clearstatcache() to clear the cache.

Syntax

filemtime(filename)

Parameter Values

Parameter Description
filename Required. Specifies the path to the file to check


Technical Details

Return Value: The last time the file content was modified as a Unix timestamp, FALSE on failure
PHP Version: 4.0+

❮ PHP Filesystem Reference
Copyright 1999-2023 by Refsnes Data. All Rights Reserved.