calculate person age by birthdate php
public function getAge($date)
{
$dob = new DateTime($date);
$now = new DateTime();
$difference = $now->diff($dob);
$age = $difference->y;
return $age;
}function get_age( $date ) {
$age = date('Y') - $date;
if (date('md') < date('md', strtotime($date))) {
return $age - 1;
}
return $age;
}
Also in PHP:
- download and install laveral
- connect mongodb with php
- base decode 64 php
- date("U") php
- date formats in php
- cache out en laravel
- am and pm in php
- The key "initial" is not recognized and ignored.
- asia time zone in php
- comment acceder à la base de données phpmyadmin sur mac ave
- ->with('success'
- execute composer with php version
- check data type php
- Create cap with php
- error reporting php
- am pm time php
- days to date php
- Woocommerce custom Flat Rate charges (by ID) Function
- check the existing image in s3 laravel
- current time in php
- clear array php
- array length php
- change php version ubuntu
- convert dd/mm/yyyy to yyyy-mm-dd in mysql php