Age Calculation

This function calculates an age given a unix timestamp

<?
function get_age(&$dob)
{
	$t = time();
	$age = ($dob < 0) ? ( $t   ($dob * -1) ) : $t - $dob;
	return floor($age / 31536000); // 60 * 60 * 24 * 365;
}
?>

Usage

No special instructions


Comments

steve
Posted on 28.05.2010 14:22

Try removing the ampersand from the parameter

guest
Posted on 28.05.2010 14:01

Its not working...

Add your comment