11-10-2007, 04:51 PM
|
#5 (permalink)
|
|
The Acquainted
Join Date: Sep 2007
Location: Leeds, UK
Posts: 141
Thanks: 6
|
Hey, this may not be what you EXACTLY need, but maybe you can expand on it:
PHP Code:
//--------------------
// Generate age based on user's birthday
//--------------------
function getage($_dob) {
$dob = date("Y-m-d", strtotime($_dob));
$ageparts = explode("-", $dob);
$age = date("Y-m-d") - $dob;
return (date("nd") < $ageparts[1] . str_pad($ageparts[2], 2, '0', STR_PAD_LEFT)) ? $age -= 1 : $age;
}
__________________
Not quite a n00b...
|
|
|
|