Home  >  Article  >  Backend Development  >  PHP filemtime() function_PHP tutorial

PHP filemtime() function_PHP tutorial

WBOY
WBOYOriginal
2016-07-13 10:27:30901browse

Definition and Usage

The filemtime() function returns the last modification time of the file content.

If successful, the time is returned as a Unix timestamp. On failure, returns false.

Grammar

filemtime(filename)

Parameters

Description

filename Required. Specifies the documents to be checked.

Description

This function returns the time when the data block in the file was last written, that is, the time when the content of the file was last modified.

Tips and Notes

Tip: The result of this function will be cached. Please use clearstatcache() to clear the cache.

Example

echo filemtime("test.txt");
echo "Last modified: ".date("F d Y H:i:s.",filemtime("test.txt"));
?>

Output:

1139919766
Last modified: February 14 2006 13:22:46.

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/818744.htmlTechArticleDefinition and usage The filemtime() function returns the last modification time of the file content. If successful, the time is returned as a Unix timestamp. On failure, returns false. Syntax filemtim...
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn