I have a field with user's date of birth.
I would like to be able to show where the age fall into i.e.
25-30 years old
instead of
27 years old
I suppose I need to create an array with the ranges but not sure how to do the rest.
Any suggestions would be highly appreciated.
Why don't you just create a drop-down for them instead of putting in their age, they select their own age-range.
Because I need to make sure they are not minors. If they are I would require guardian's information.
Something like this:
$year = 27; $tmp_ = round($year/10)*10; if ( $tmp_ > $year ) { echo ($tmp_ - 5)." - {$tmp_} years old"; } else { echo "{$tmp_} - ".($tmp_ + 5)." years old"; }
Great Thanks.