date question

From: Date: Wed, 19 Nov 2003 22:40:34 +0000
Subject: date question
Groups: php.general 
Request: Send a blank email to php-general+get-170354@lists.php.net to get a copy of this message
Hello all, I would like to create a php function as follows: function get_next_dates($ndays) { /*
     1. get the current date
     2. create an array say $results
     3. Store the dates for the next $ndays in $results
*/ return $results } So in my main program I can include the file with the function and use it as follows: <?php $next_4_dates = get_next_dates(4); ?> $next_4_days[0] -> 11/20 $next_4_days[1] -> 11/21 $next_4_days[2] -> 11/22 $next_4_days[3] -> 11/23 if today was 11/19 Is there an easy way to do this? Can I somehow use something like getdate+7 say to get 7 days ahead? many thanks, Ahbaid

« previous php.general (#170354) next »