comparing date with different seasons in php

Inhiliselejerre

New Member
hi i stored a date that is taken from form in a variable using php and now i want to check whether the date is in the season or not..the code i written is as follows:\[code\]$year = 2012;$month1 = $_POST["month1"];$date = $_POST["date"];$result = "{$year}/{$month1}/{$date}";echo $result;\[/code\]and now\[code\]// finding first saturday in febraury $saturday = strtotime('First Saturday '.date('F o', mktime(0,0,0, $month, 1, $year))); echo "this is the first saturday in the given year:"; echo date('Y/m/d', $saturday); // calculating first 12 weeks after the first saturday echo "<br/>"; $season1 = strtotime ( '+12 week' , $saturday); echo "<br/>this is the first season:"; echo date('Y/m/d', $season1); echo "<br/>"; // calculating the one week gap after the first 12 weeks $season2 = strtotime ('+1 week' , $season1); echo "<br/>this is the first week break:"; echo date('Y/m/d', $season2); echo "<br/>";\[/code\]Here what i need to do is to check whether the date given by the user is in season1 or season2..for doing so i tried as\[code\]if ($result <= $season1) { echo "League yet to be opened"; } else { echo "league 1 is opened"; }\[/code\]but the condition is not checking here, and like wise i need to check the date entered by the user with 8 seasons how can i do that....any help is much appreciated....thanks in advance..
 
Back
Top