Source Code:
(back to article)
<?php $date = new DateTime('2022-06-15'); if ($date->format('N') >= 6) { echo 'The date is a weekend'; } else { echo 'The date is not a weekend'; }
Result:
Report an issue