How to check date is which day in PHP


In this example you can also check Sunday, Sat day etc.

Example

<?php
    $givendate='2011-01-01';
    $MyGivenDateIn = strtotime($date);
    $ConverDate = date("l", $MyGivenDateIn);
    $ConverDateTomatch = strtolower($ConverDate);
    echo $ConverDateTomatch;
    if(($ConverDateTomatch == "saturday" )|| ($ConverDateTomatch == "sunday")){
    echo "This is a weekend date";
    } else {
    echo "This is no weekend date";
    }
?>