/ Published in: PHP
This function gets birth date as an argument and it returns the age of the person; it's very useful when building communities or social media sites.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
<?php function age($date){ if($time === false){ return ''; } $year_diff = ''; if ($day_diff < 0 || $month_diff < 0) $year_diff-; return $year_diff; } ?>
URL: http://www.apphp.com/index.php?snippet=php-calculate-age-using-birth-date