Source Code:
(back to article)
<?php $date = '2022-06-15'; $dayOfWeek = date('w', strtotime($date)); if ($dayOfWeek == 0 || $dayOfWeek == 6) { echo 'The date is a weekend'; } else { echo 'The date is not a weekend'; }
Result:
Report an issue