Code: Seeing if an image has been updated.
Posted: Mon Dec 08, 2008 4:20 pm
revised
A community of PHP developers offering assistance, advice, discussion, and friendship.
http://forums.devnetwork.net/
Code: Select all
<?php
$imagefile = "image.jpg";
$your_data = date("m/d/y H:i:s", filemtime("image.jpg"));
$myFile = "time.txt";
$fh = fopen($myFile, 'r');
$theData = fread($fh, filesize($myFile));
if ($your_data == $theData) {
echo "<img src='image.jpg'><br>File has not been updated <br>$your_data<br>$theData";
}
if ($your_data != $theData) {
echo "<img src='image.jpg'><br>File has been updated, <br>$your_data<br>$theData<br>";
}
?>File has been updated,
12/07/08 11:03:13
12/07/08 11:03:13