Printing date out of array
| From: | Michael S. Dunsavage | Date: | Sun, 31 Aug 2008 23:44:47 +0000 |
| Subject: | Printing date out of array | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-279175@lists.php.net to get a copy of this message | ||
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