Search
 
SCRIPT & CODE EXAMPLE
 

PHP

php get age from dob

Simple method for calculating Age from dob: $_age = floor((time() - strtotime('1986-09-16')) / 31556926); 31556926 is the number of seconds in a year.
Comment

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;
	}
Comment

PREVIOUS NEXT
Code Example
Php :: laravel sum group by 
Php :: how to get array dont similer elements in php 
Php :: how to add properties to the request object 
Php :: unset _post 
Php :: Hide all updates from WordPress 
Php :: php string max length 
Php :: Find out how many years there are in php between years 
Php :: while loop in laravel 
Php :: array merge php 
Php :: how to run symfony project 
Php :: excerpt length wordpress 
Php :: laravel blade date format 
Php :: laravel redirect back with input 
Php :: twig print_r 
Php :: php 301 redirect 
Php :: php get all function arguments 
Php :: force https redirect php 
Php :: php get number from string 
Php :: disable edit-link storefront 
Php :: php transform associative array to array 
Php :: foreign key nullable in laravel 
Php :: php get content phpinfo without show 
Php :: laravel abort_if 
Php :: laravel deployment 
Php :: delete uploaded media file wp using code 
Php :: laravel hasone users relations 
Php :: websocket 2006 MySQL server has gone away 
Php :: php client enable short tags 
Php :: laravel simplexmlelement xml add attribute 
Php :: php 7.4 extension sqlite ubuntu 
ADD CONTENT
Topic
Content
Source link
Name
1+9 =