PHP date function for exact date.?

Michael Westen

New member
I know how to use php to echo something on a certain day of the week:
if day = Fri echo ""its friday".
But how can i do an exact date like day/month/yeah.
if date = 2/15/10 echo "Happy Presidents Day"

Thanks a lot.
 
Here's a really quick and easy way. If you had a lot of dates to do, the code would get kind of bulky, though.

$currMonth = date("n"); //current month without leading zero
$currDay = date("j"); //current day without leading zero

if($currMonth == '2' && $currDay == '15')
{
echo 'Happy Presidents Day!';
}
 
Back
Top