Oiiii Oiiii,
How do you write IF statments in PHP, via dates...
So, like, IF date is a holiday period then ' do something else ' do something else end if
How would you write this in PHP?
Thanks
K
oi oi? gotta be a uk bloke :-)
One way is to convert all dates to timestamps (the number of seconds since 01-01-1970) and compare them, something like
if ((current_timestamp > timestamp of beginning of holidays) AND (current_timestamp < timestamp_of_end_of_holiodays)) { //this } ELSE { // that };
more about what you can do with dates etc: http://www.php.net/manual/en/ref.datetime.php