xzczxcxc - PHP Online
Form of PHP Sandbox
Enter Your PHP code here for testing/debugging in the Online PHP Sandbox. As in the usual PHP files, you can also add HTML, but do not forget to add the tag <?php
in the places where the PHP script should be executed.
Result of php executing
Full code of xzczxcxc.php
- <?php
- var_dump(check_time_range('12:20', '08:20'));
- function check_time_range($start, $end)
- {
- $startTime = strtotime($start);
- $endTime = strtotime($end);
- $now = time();
- if ($startTime > $endTime){
- $endTime = strtotime('+1 days', $endTime);
- $now = strtotime('+1 days', $now);
- }
- echo(date("Y-m-d H:i\n", $now));
- echo(date("Y-m-d H:i\n", $endTime));
- echo(date("Y-m-d H:i\n", $startTime));
- return $now >= $startTime && $now <= $endTime;
- }