PHP filectime() Function

Definition

The filectime() function returns the last time the specified file was changed, including changes to permissions, owner, group or other metadata.

Syntax

PHP filectime() Function has the following syntax.

filectime(filename)

Parameter

ParameterIs RequiredDescription
filenameRequired.File to check

Note

The result of this function are cached. Use clearstatcache() to clear the cache.

Use the filemtime() function to return the last time the file content was changed.

Return

This function returns the last change time as a Unix timestamp on success, FALSE on failure.

Example

Get the last change time for a file


<?php/*from  www . j a  va 2  s . c om*/
echo filectime("test.txt");
echo "\n";
echo "Last change: ".date("F d Y H:i:s.",filectime("test.txt"));
?>

The code above generates the following result.





















Home »
  PHP Tutorial »
    Function reference »




PHP Array Functions
PHP Calendar Functions
PHP Class Functions
PHP Data Type Functions
PHP Date Functions
PHP File Functions
PHP Image Functions
PHP Math Functions
PHP MySQLi Functions
PHP SimpleXML Functions
PHP String Functions
PHP XML Functions
PHP Zip Functions