Ads
affiliate program
Pages
Home
About Kapil Kumar
Mysql
Sunday, 30 November 2014
Calculating age in years in php
Age calculation in php
Declare a function =>
function getAge( $dob, $date )
{
$dob=strtotime($dob);
$date=strtotime($date);
$age = 0;
while( $date > $dob = strtotime('+1 year', $dob))
{
++$age;
}
return $age." years";
}
Read more »
Newer Posts
Older Posts
Home
Subscribe to:
Posts (Atom)