Skip to content

Instantly share code, notes, and snippets.

@dilab
Last active November 18, 2015 06:31
Show Gist options
  • Save dilab/88ae82ebc7262cd04056 to your computer and use it in GitHub Desktop.
Save dilab/88ae82ebc7262cd04056 to your computer and use it in GitHub Desktop.
$oDateNow = new DateTime();
$oDateBirth = new DateTime($sDateBirth);
$age = $oDateNow->diff($oDateBirth)->y;
// its take day into consideration
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment