note 73266 deleted from function.date by felipe

From: Date: Sun, 09 Dec 2007 13:34:39 +0000
Subject: note 73266 deleted from function.date by felipe
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-132991@lists.php.net to get a copy of this message
Note Submitter: dragon at alimex dot biz ---- The function posted by mybenchmarkid down is great, but I would suggest a slight change. The "$days" line should be without the "+1" at the end: $days = (strtotime($endDate) - strtotime($startDate)) / 86400; and the "for" line should be with "<=" instead of "<": for($i=0; $i<=$days; $i++) This way you can use a specific endDate or just use today: $days = (time() - strtotime($startDate)) / 86400; It will work both ways. Bobby

« previous php.notes (#132991) next »