Created
June 29, 2020 12:39
-
-
Save heyitsnovi/92573c0e08b8523fc30dd1c2267575d5 to your computer and use it in GitHub Desktop.
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 | |
date_default_timezone_set('Asia/Manila'); | |
function isBetween($from, $till, $input) { | |
$fromTime = strtotime($from); | |
$toTime = strtotime($till); | |
$inputTime = strtotime($input); | |
return($inputTime >= $fromTime and $inputTime <= $toTime); | |
} | |
echo isBetween('06:00','24:00',date('H:i')); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment