View Single Post
Old 11-10-2007, 04:51 PM   #5 (permalink)
CMellor
The Acquainted
Upcoming Programmer 
 
CMellor's Avatar
 
Join Date: Sep 2007
Location: Leeds, UK
Posts: 141
Thanks: 6
CMellor is on a distinguished road
Default

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 -= $age;

__________________
Not quite a n00b...
CMellor is offline  
Reply With Quote