Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

PHP function get age

	function get_age($birthday='1994-02-14'){
		$date = new DateTime($birthday);
		$now = new DateTime();
		$interval = $now->diff($date);
		return $interval->y;
	}
 
PREVIOUS NEXT
Tagged: #PHP #function #age
ADD COMMENT
Topic
Name
1+8 =