[ create a new paste ] login | about

Link: http://codepad.org/hHHKqJQ6    [ raw code | output | fork ]

PHP, pasted on Nov 7:
<?php

$dates = array( '1901-09-01', '1901-12-01');

foreach( $dates as $date ) {

    $time = strtotime( $date );

    $is_sunday = ( date( 'l', $time ) == "Sunday" );

    if( $is_sunday ) {

        echo "$date is Sunday.";

    } else {

        echo "$date is NOT Sunday.";

    }

    echo "\n";

}

?>


Output:
1
2
1901-09-01 is NOT Sunday.
1901-12-01 is NOT Sunday.


Create a new paste based on this one


Comments: