Entry
How do I compare dates? If I want to display only information entered in one given month(october) and nothing before and nothing after this month.
Nov 10th, 2000 04:59
Henrik Hansen, agnes rynkiewicz, Onno Benschop,
If you have two dates ($date1 and $date2) in the form Y-m-d, you can
for example use the following:
if($date1 == $date2)
echo "the dates are identical";
else
echo "the dates are not the same";
If you only want to display something after a certain month try
something like this:
//get the month name from our date
$month = substr($date, 5, 2);
//see if the month is equal to this months date
if($month == date("m", time()))
echo "show the info";