/ Published in: PHP
Calculate age; given date.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
/* * calculateAge() * @action: calculate age from given date * @params: * birthday: birthday in format YYYY-MM-DD * @return: age (integer ) * @modified : 27 August 2010 * @modified by: Sucl Tandukar */ function calculateAge ($birthday) { if ($day_diff < 0 || $month_diff < 0) $year_diff--; return $year_diff; }