Checking for the day of the week : strftime « Date « PHP






Checking for the day of the week

 
<?php
if (1 == date('w')) {
    print "Welcome to the beginning of your work week.";
}

if (1 == strftime('%w')) {
    print "Only 4 more days until the weekend!";
}
  
  








Related examples in the same category

1.Format Characters Used by the strftime() Function for Day
2.Format Characters Used by the strftime() Function for Formatting Characters
3.Format Characters Used by the strftime() Function for Full Date and/or Time
4.Format Characters Used by the strftime() Function for Hour
5.Format Characters Used by the strftime() Function for Minute
6.Format Characters Used by the strftime() Function for Month
7.Format Characters Used by the strftime() Function for Second
8.Format Characters Used by the strftime() Function for Week
9.Format Characters Used by the strftime() Function for Year
10.strftime.php
11.Generating the days in a month
12.Generating the days in a week
13.Finding days of the week, month, and year
14.Finding the current date and time
15.Printing a formatted date string with strftime()
16.Printing a formatted time string with other text
17.Printing a greeting or printing a form
18.Skip ahead one day to the Tuesday after the first Monday