Re: echo date("l");

From: Date: Tue, 07 Feb 2006 22:10:53 +0000
Subject: Re: echo date("l");
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-230058@lists.php.net to get a copy of this message
John Nichel wrote:
Khristian Hamilton-Bailey wrote:
Hi, I currently use the date function as follows: <?php $day= date("l"); ?> so I can then use this to call records from a database where todays day matches that of a record, however I would also like to call records for tomorrow, is there a way in which I could use the date function to add one day so that as well as the above i could also use something like $tomorrow= xxxxxxxxxxxxxxxxx Many thanks for any help. Khristian
http://us3.php.net/date Look at example 3
While that would work surely it's more efficient to call date('l', strtotime('+1 day')), 1 date call and 1 strtotime call than to call date three times? It would need a test script to find out, but even if they're almost the same I find the strtotime solution easier to read. -Stut

« previous php.general (#230058) next »