note 114508 added to function.filemtime
| From: | son9ne at gmail dot com | Date: | Sat, 01 Mar 2014 19:58:12 +0000 |
| Subject: | note 114508 added to function.filemtime | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-198754@lists.php.net to get a copy of this message | ||
If you do use:
<?php
$filename = 'somefile.txt';
$fmtime = filemtime($filename);
if (!$fmtime) {
echo "$filename wurde zuletzt modifiziert:: " . date ("F d Y H:i:s.",
$fmtime);
}
?>
Make note that it will throw a warning as the documentation states. While tobias makes a good point
for production, when error reporting is off, this can increase your performance over using
file_exists. However, if error reporting is on and it's writing to a log... this
is not the case. Obviously this varies on sever specs and the size of the error log. For most cases,
it's still ideal to use the file_exists method.
----
Server IP: 64.71.164.2
Probable Submitter: 99.38.93.245
----
Manual Page -- http://php.net/manual/en/function.filemtime.php
Edit -- https://master.php.net/note/edit/114508
Del: integrated -- https://master.php.net/note/delete/114508/integrated
Del: useless -- https://master.php.net/note/delete/114508/useless
Del: bad code -- https://master.php.net/note/delete/114508/bad+code
Del: spam -- https://master.php.net/note/delete/114508/spam
Del: non-english -- https://master.php.net/note/delete/114508/non-english
Del: in docs -- https://master.php.net/note/delete/114508/in+docs
Del: other reasons-- https://master.php.net/note/delete/114508
Reject -- https://master.php.net/note/reject/114508
Search -- https://master.php.net/manage/user-notes.php