note 60426 deleted from function.mktime by derick
| From: | derick@php.net | Date: | Sun, 24 Sep 2006 11:51:00 +0000 |
| Subject: | note 60426 deleted from function.mktime by derick | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-117499@lists.php.net to get a copy of this message | ||
Note Submitter: tperrett at butlerandtanner dot com
----
Handy function for working out the number of days until and event, its basic, but does what i need
it too and may help somone else as this wasnt easily obvious to me when trying to do it. cheers
function fromnow($from){
if($from) {
$r = ((mktime(0,0,0,date('m'),date('d'),date('Y')) - $from) /
86400);
return number_format($r,0);
} else {
return null;
}
}