Darano

PHP getAge

Sep 29th, 2018
226
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.23 KB | None | 0 0
  1. <?php
  2. function getAge($day,$mon,$year){
  3.     $now= mktime(0, 0, 0, date('m'), date('d'), date('Y'));
  4.    $dateofbirth= mktime(0, 0, 0, $mon, $day, $year);
  5.    return $age   = intval(($now- $dateofbirth) / (3600 * 24 * 365));
  6.   }
  7. ?>
Advertisement
Add Comment
Please, Sign In to add comment