Skip to content

Instantly share code, notes, and snippets.

@binarykore
Created April 25, 2022 05:17
Show Gist options
  • Save binarykore/a320a0cd6be6a45ef61cc7bca7bb5243 to your computer and use it in GitHub Desktop.
Save binarykore/a320a0cd6be6a45ef61cc7bca7bb5243 to your computer and use it in GitHub Desktop.
Calculates the Year of given Time from Starting Year to Current Year..
<?php
$_currentyear = date("Y");
$_startingyear = "2016";
$_timespan = abs($_startingyear - $_currentyear);
$_hash = [];
for($_i = 0;$_i <= $_timespan;$_i++){
$_hash[] = ($_startingyear + $_i);
}
echo(join("\r\n",$_hash));
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment