I want to make a form with 3 select boxes, one for month, one for day, and one for year. I want to hold the values in an array and use the array values to put them into select boxes. I successfully made the month array and select box but the problem is selecting how many days in the month. How can I make it so that the days are able to be shown in the array according to what month it is? ex: January, March, May have 31 days and February has 29/30, April has 30 and depending on which month is chosen the corresponding day is available for selection.

This is my PHP code for months:
$month = array ("", "Jan", "Feb", "Mar", "Apr", "May",
"Jun", "Jul", "Aug", "Sep", "Oct",
"Nov", "Dec");


echo '<select name="dobmonth>';

foreach ($month as $dobmonth)
{
echo '<option value="'.$dobmonth.'">'.$dobmonth.'</option>';
}
echo '</select>';

Thanks for any help.