Last active
July 17, 2018 19:18
-
-
Save gareth-gillman/b2299e80740fef076b9ab32e0fb6ae48 to your computer and use it in GitHub Desktop.
php check hours
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$server_date = get_date(); | |
$date = strtotime( $server_date ); | |
$hour = date('H', $date); | |
if( $hour > 9 && $hour < 20 ) { | |
echo 'it's between 9am and 8pm'; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment