I'm currently getting the user's birthday from Facebook and storing it in the standard m/d/Y that Facebook supplies (Ex: 05/21/1982). I have an edit profile page in which I need to assign the day, month and year to 3 separate variables in order to allow the user to change his or her birthday as well as pre-select the correct birthday.
My code that pertains to only the days variable which I would want to be assigned to $days_var and in the above example of 05/21/1982 would be 05 is pasted below:
<?php
$days = range(1, 31);
foreach($days as $day) {
?>
<option value="<?php echo($day) ?>" <?php if ($days_var = $day){echo "selected='1'";}?> ><?php echo($day) ?></option>
<?
}
?>
Thanks. EDIT: I have only given the days example but would obviously need the day, month and year variables.