RE: [PHP] populate a list menu
| From: | Bruce Levick | Date: | Tue, 07 Jan 2003 06:13:31 +0000 |
| Subject: | RE: [PHP] populate a list menu | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-130533@lists.php.net to get a copy of this message | ||
That's sweet. Can you just satisfy my curiosity and explain the 86400??
I am thinking this might be minutes??
-----Original Message-----
From: Justin French [mailto:justin@indent.com.au]
Sent: Tuesday, January 07, 2003 4:12 PM
To: Bruce Levick; php-general@lists.php.net
Subject: Re: [PHP] populate a list menu
I'm *positive* there is a better way, but this should work (untested):
<form>
<select name="date">
<?
$stamp = time();
$i = 0;
while($i <= 30)
{
if($i > 0) { $stamp = $stamp + 86400; }
$date = date('d-m-Y',$stamp);
echo "<option value=\"{$date}\">{$date}</option>";
$i++;
}
?>
</select>
</form>
Cheers,
Justin
on 07/01/03 4:39 PM, Bruce Levick (brucel@ispye.com) wrote:
> Howdy,
> I am looking to populate a list menu with the current date and then
> the 30days after that current date. Is there a small snippet of code
> that achieves this??
>
> Cheers
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
> ---
> [This E-mail scanned for viruses]
>
>