RE: [PHP] request

From: Date: Sat, 19 Apr 2003 19:57:58 +0000
Subject: RE: [PHP] request
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-144498@lists.php.net to get a copy of this message
> $user_name = "Paul"; > $user_date = "1981-08-03"; > echo "$user_name is $user_age years old"; > > what should i do that $user_age count how old is user One method: $dob = strtotime($user_date); $user_age = date('Y')-date('Y',$dob)-(date('z') < date('z',$dob)?1:0); ---John W. Holmes... PHP Architect - A monthly magazine for PHP Professionals. Get your copy today. http://www.phparch.com/

« previous php.general (#144498) next »