array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'de', ), 'this' => array ( 0 => 'splfileinfo.getmtime.php', 1 => 'SplFileInfo::getMTime', 2 => 'Gets the last modified time', ), 'up' => array ( 0 => 'class.splfileinfo.php', 1 => 'SplFileInfo', ), 'prev' => array ( 0 => 'splfileinfo.getlinktarget.php', 1 => 'SplFileInfo::getLinkTarget', ), 'next' => array ( 0 => 'splfileinfo.getowner.php', 1 => 'SplFileInfo::getOwner', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'en', 'path' => 'reference/spl/splfileinfo/getmtime.xml', ), 'history' => array ( ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); contributors($setup); ?>
(PHP 5 >= 5.1.2, PHP 7, PHP 8)
SplFileInfo::getMTime — Gets the last modified time
Returns the time when the contents of the file were changed. The time returned is a Unix timestamp.
Diese Funktion besitzt keine Parameter.
Returns the last modified time for the file, in a Unix timestamp on success, or false
on failure.
Beispiel #1 SplFileInfo::getMTime() example
<?php
$info = new SplFileInfo('example.jpg');
echo 'Last modified at ' . date('g:i a', $info->getMTime());
?>
Das oben gezeigte Beispiel erzeugt eine ähnliche Ausgabe wie:
Last modified at 1:49 pm