Home  >  Article  >  Backend Development  >  php filemtime - Get file modification time_PHP tutorial

php filemtime - Get file modification time_PHP tutorial

WBOY
WBOYOriginal
2016-07-20 11:01:001152browse

php filemtime - Get file modification time ​

filemtime
(PHP 4, PHP 5)

filemtime - Get file modification time

Description
international filemtime (string $filename)
This function returns when the data block of the file is written, which is when the contents of the file changed.

Parameters

File name
File path.


Return value
Returns the time the file was last modified, or FALSE in case an error occurs. The time returned is as a Unix timestamp, which is suitable for the date() function.

Example

Example #1 filemtime() example

// outputs e.g. somefile.txt was last modified: December 29 2002 22:16:23.

$filename = 'somefile.txt';
if (file_exists($filename)) {
echo "$filename was last modified: " . date ("F d Y H:i:s.", filemtime($filename));
}
?>


www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/445461.htmlTechArticlephp filemtime - Get the file modification time filemtime (PHP 4, PHP 5) filemtime - Get the file modification time description international filemtime (String $filename) This function returns when...
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