php echo different content on different dates -


i using date format echo example: thursday 8th august 2013

$day = date("l js f y");

i echo different content on different dates

for example if wednesday 25th december 2013 can echo "merry christmas"

this have tried, time format (y-m-d = 2013-25-12) have tried adding wednesday 25th december 2013.

what date format should $day = if im using $day = date("l js f y");

<p><?php if( $day == '2013-25-12' )  echo 'action="merry christmas"';       ?></p> 

use strtotime() , date() formatted date compare $day:

<?php if( $day === date("l js f y", strtotime('2013-25-12'))) {     echo 'merry christmas!'; } ?> 

check out php documentation on date function. includes formatting specifications: http://php.net/manual/en/function.date.php


Comments

Popular posts from this blog

plot - Remove Objects from Legend When You Have Also Used Fit, Matlab -

java - Why does my date parsing return a weird date? -

Need help in packaging app using TideSDK on Windows -