Skip to content

Instantly share code, notes, and snippets.

@interactiveRob
Last active April 12, 2018 15:56
Show Gist options
  • Save interactiveRob/1e7495dd50155e88dc7643388b225714 to your computer and use it in GitHub Desktop.
Save interactiveRob/1e7495dd50155e88dc7643388b225714 to your computer and use it in GitHub Desktop.
Easy PHP check Day of Week
<?php
$day = date('D');
if($day == 'Mon' || $day == 'Wed' || $day == 'Fri'):
//do something
else:
endif;
?>
@interactiveRob
Copy link
Author

interactiveRob commented Apr 12, 2018

You can use the PHP date() function with a capital 'D' to return an abbreviated string for today's date.
Returned Values:
Mon
Tue
Wed
Thu
Fri
Sat
Sun

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment