note 48280 added to function.filemtime
| From: | KlaasGeldof at osu1 dot php dot net | Date: | Fri, 17 Dec 2004 17:30:46 +0000 |
| Subject: | note 48280 added to function.filemtime | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-81923@lists.php.net to get a copy of this message | ||
I use this function to ensure the images on the website are up to date:
<?
$path = "img/picture.jpg";
$src = $path."?".filemtime($path);
print "<img src=$src>";
?>
The image is cached by the browser, but as soon as the image is modified, the url will change
(although the actual filename is not changed) and the browser refreshes the image.
----
Manual Page -- http://www.php.net/manual/en/function.filemtime.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+48280
Delete -- http://master.php.net/manage/user-notes.php?action=delete+48280&report=yes
Reason: bad code -- http://master.php.net/manage/user-notes.php?action=delete+48280&report=yes&reason=bad+code
Reason: spam -- http://master.php.net/manage/user-notes.php?action=delete+48280&report=yes&reason=spam
Reason: useless example -- http://master.php.net/manage/user-notes.php?action=delete+48280&report=yes&reason=useless+example
Reason: contains commercial links -- http://master.php.net/manage/user-notes.php?action=delete+48280&report=yes&reason=contains+commercial+links
Reason: useless note -- http://master.php.net/manage/user-notes.php?action=delete+48280&report=yes&reason=useless+note
Reject -- http://master.php.net/manage/user-notes.php?action=reject+48280&report=yes
Search -- http://master.php.net/manage/user-notes.php