Skip to content

Instantly share code, notes, and snippets.

@sajhd
Last active December 14, 2017 14:24
Show Gist options
  • Select an option

  • Save sajhd/fbfbe080635cd0282ce3ddc3984ebcdf to your computer and use it in GitHub Desktop.

Select an option

Save sajhd/fbfbe080635cd0282ce3ddc3984ebcdf to your computer and use it in GitHub Desktop.
Work on season
<?php
//get current month
$currentMonth = DATE("m");
echo $currentMonth;
//retrieve season
if ($currentMonth >= "03" && $currentMonth <="05")
$season = "spring";
elseif ($currentMonth >= "06" && $currentMonth <= "08")
$season = "summer";
elseif ($currentMonth >= "09" && $currentMonth <= "11")
$season = "autumn";
else
$season = "winter";
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment