Skip to content

Instantly share code, notes, and snippets.

@grandmanitou
Created March 20, 2014 09:17
Show Gist options
  • Select an option

  • Save grandmanitou/9660051 to your computer and use it in GitHub Desktop.

Select an option

Save grandmanitou/9660051 to your computer and use it in GitHub Desktop.
Get age from birthdate
<?php
function age($date)
{
$d = strtotime($date);
//echo strftime('%a %d %b %Y', $d).' > ';
return (int) ((time() - $d) / 3600 / 24 / 365.242);
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment