Different values for date before, between, and after

Hi,

I’m trying to do the following, here is sudo code:

If (today < 03/22)
echo graphic 1

elseif (today is between 03/22 and 03/25)
echo graphic 2

else
echo graphic 3

The strtotime function will be of a great help to you there.

So would this code then do it?

$date1 = strtotime("now");
$date2 = strtotime("22 March 2010");
$date3 = strtotime("25 March 2010");

if ($date1 < $date4) {
     echo "before";
} elseif ($date1 > $date3) {
     echo "after";
} else {
     echo "during";
}

It would help if the variables are named to something more descriptive, such as $now, $earliestEaster, $sloveniaMothersDay

Keep in mind that the dates are at midnight, so when checking if greater, you will want to use >= instead

Otherwise, I think that you have grasped the basic idea.