Jump to content

If Date is less than or equal to ...


spacepoet

Recommended Posts

Hi:

 

I am working with a little bit of code, but not certain if my syntax is correct. Doesn't seem to be doing what I need it to do:

<?php

if (date <= "4/8/2011")
     echo "Event Details";
     else
     echo "Default Text";
?>

 

Basically, I want to show "Event Details" if the date is before or on 4/8/2011.

 

If it is after 4/8/2011, I want to show "Default Text"

 

It seems to be doing the opposite.

 

What am I missing?

Link to comment
https://forums.phpfreaks.com/topic/229909-if-date-is-less-than-or-equal-to/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.