 |
Title: Determining Age from Birthdate information Marked Cool (Review this resource) Author: CYBER_Aeon Posted On: 2004-11-16 Category: Home > PHP Hints and Tips
Popularity:
Description: A quick way to figure out someone's age from their month, day and year of birth. Good for Registration Systems.
Total Hits: 1328 Total Votes: 0
Total Points: 0 (0 reviews) [ Download ]
Page Navigation: [1]
|
php:
//
// Inputs
//
$Month = "1"; // January
$Day = "12";
$Year = "1986";
// -----------------
// Begin Code
// -----------------
$Now = mktime( 0, 0, 0, date("n"), date("j"), date("Y") );
$Then = mktime( 0, 0, 0, $Month, $Day, $Year );
$Age = floor((((($Now - $Then) / 60) / 60) / 24) / 365.25);
//
// Output
//
echo $Age;
|
Page Navigation: [1]
|
|
 |