note 21014 rejected from function.time by victor
| From: | victor@php.net | Date: | Sat, 24 Aug 2002 16:18:42 +0000 |
| Subject: | note 21014 rejected from function.time by victor | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-35542@lists.php.net to get a copy of this message | ||
hi:~)
u can do simply compare, for eg. to check if the file is older than 5 minutes:
<?php
$str_status_filename = "emailing.status"; // nazwa pliku, ktory bedzie tworzony i
modyfikowany, jako status dzialania mailingu
if (file_exists($str_status_filename)) {
$int_status_filemtime = filemtime($str_status_filename);
echo "data pliku: $int_status_filemtime<BR>";
$czas = time();
$roznica = $czas - $int_status_filemtime;
echo "data: $czas<BR>";
echo "roznica: $roznica<BR>";
if ($roznica > 300) {
echo "KUKURYKU!<BR>";
}
} else {
echo "Nie ma pliku<BR>";
}
?>
of course, u have to make any file under the name emailing.status and wait 5 minutes (5 * 60
seconds) ;~)
note that time() and filemtime() returns time time in UNIX format for a GMT date
(above script is made & tested by me :~))
greetz :~)
Sir_Fred
/Martinez, I was made in Poland too :~)/