Skip to content

Instantly share code, notes, and snippets.

@madysondesigns
Created April 5, 2016 01:02
Show Gist options
  • Save madysondesigns/98eea8c547382a19dca8e913fa49305c to your computer and use it in GitHub Desktop.
Save madysondesigns/98eea8c547382a19dca8e913fa49305c to your computer and use it in GitHub Desktop.
Calculate years since
function calc_years_since($year) {
$since = date("Y") - $year;
if ($since == 1) {
$since .= " year";
} else {
$since .= " years";
}
echo $since;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment