Sponsored by NuSphere - PHP Software for PHP Application Developers - On Sale This Week for $100 off


PHP Tutorials and Scripts   




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: 1 points out of 10    

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]



© Copyright 2003-2008 www.php-editors.com. The ultimate PHP Editor and PHP IDE site.