Created
May 27, 2013 20:52
-
-
Save EricTendian/5659020 to your computer and use it in GitHub Desktop.
Calculate what year in a 4-year program (high school or college) you are in based off of your graduation year. $gradYear is your graduation year, and $year corresponds to your current year (1-Freshman, 2-Sophomore, 3-Junior, 4-Senior).
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$currentMonth = date("m", time()); | |
$currentYear = date("Y", time()); | |
if (7 > $currentMonth < 12) $year = 4 - ($gradYear - ($currentYear+1)); | |
else $year = 4 - ($gradYear - ($currentYear)); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment