Re: Printing date out of array

From: Date: Sun, 31 Aug 2008 23:52:18 +0000
Subject: Re: Printing date out of array
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-279176@lists.php.net to get a copy of this message
I would suggest the time() value to be saved in your database. Since the date() function can use that as the second parameter and you can use any format date() allows. Or make your own. Ólafur Waage olafurw@gmail.com 2008/8/31 Michael S. Dunsavage <mikesd@ptd.net>: > This is my date array: > > $months = array (1 => 'January', 'February', 'March', > 'April', 'May', > 'June', 'July', 'August', 'September', > 'October', 'November', > 'December'); > > > > This is my date select in the form: > > > echo '<select name="day">'; > for ($day = 1; $day <= 31; $day++) { > echo "<option value=\"$day\">$day</option>\n"; > } > echo '</select>'; > > echo '<select name="year">'; > $year = 2008; > while ($year <= 2020) { > echo "<option value=\"$year\">$year</option>\n"; > $year++; > } > echo '</select>'; > > > This is how it submits to mysql: > > > > > Now, when I submit it to mysql, it's all in mm-dd-yyyy format. > > When I submit it to an e-mail, I'd like it to me Month-dd-yyyy. How > could I do this? > > Would it be easier to pull the date from mysql and break it down > somehow? And if so how would I do that? > > > -- > Michael S. Dunsavage > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > >

« previous php.general (#279176) next »