note 48280 deleted from function.filemtime by nlopess
| From: | nlopess@php.net | Date: | Fri, 17 Dec 2004 20:13:41 +0000 |
| Subject: | note 48280 deleted from function.filemtime by nlopess | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-81939@lists.php.net to get a copy of this message | ||
Note Submitter: Klaas Geldof
----
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.