Search
 
SCRIPT & CODE EXAMPLE
 

PHP

calcul age php datetime

function get_age( $date ) { 
    $age = date('Y') - $date; 
   if (date('md') < date('md', strtotime($date))) { 
       return $age - 1; 
   } 
   return $age; 
} 
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 :: how to use sseders in laravel 
Php :: calcul age php datetime 
Php :: customer io send_at api 
Php :: vc_map type number 
Php :: wordpress acf get checkbox options 
Php :: php get domain name from url 
Php :: php extract email address from string 
Php :: function that checks number only in php 
Php :: laravel remove public from url 
Php :: check if $_files is empty php 
Php :: take fraction of number in laravel 
Php :: capitlise php 
Php :: check php version mac 
Php :: php replace 
Php :: Detecting russian characters on a form in PHP 
Php :: laravel get header from request 
Php :: php str_replace multiple 
Php :: laravel scaffolding 
Php :: laravel collection implode 
Php :: write file in php 
Php :: php array continued 
Php :: how push to array whit key in laravel 
Php :: get current user email wordpress 
Php :: how to get all rows from a table except some rows in laravel 
Php :: fixuphost 
Php :: Composer detected issues in your platform: Your Composer dependencies require a PHP version "= 8.0.2". 
Php :: laravel public access inserver using htaccess 
Php :: Limit Product Name in Magento2 
Php :: how to override default name for apiresourc route in laravel 
Php :: check if all values in array are equal php 
ADD CONTENT
Topic
Content
Source link
Name
1+1 =