Skip to content

Instantly share code, notes, and snippets.

@heyitsnovi
Created June 29, 2020 12:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save heyitsnovi/92573c0e08b8523fc30dd1c2267575d5 to your computer and use it in GitHub Desktop.
Save heyitsnovi/92573c0e08b8523fc30dd1c2267575d5 to your computer and use it in GitHub Desktop.
<?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