Write a PHP script to check whether a date is a weekend or not.
<?php $dt='2011-01-04'; $dt1 = strtotime($dt); $dt2 = date("l", $dt1); $dt3 = strtolower($dt2); if(($dt3 == "saturday" )|| ($dt3 == "sunday")) { echo $dt3.' is weekend'."\n"; } else { echo $dt3.' is not weekend'."\n"; } ?>
Sample Output:
tuesday is not weekend
total answers (1)
start bookmarking useful questions and collections and save it into your own study-lists, login now to start creating your own collections.
Sample Output: