Мое - 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.



Your result can be seen below.

Result of php executing





Full code of Мое.php

  1. <?php
  2. $start = "04:00";
  3. $end = "18:05";
  4. $time = strtotime(date('h:i'));
  5. if (strtotime($start) > strtotime($end)) {
  6.     $timestart = strtotime($start);
  7.     $timeend = strtotime("24:00") + strtotime($end) - strtotime("00:00");
  8. } else {
  9.     $timestart = strtotime($start);
  10.     $timeend = strtotime($end);
  11. }
  12. echo $timestart, "\n";
  13. echo $timeend, "\n";
  14. echo date('h:i'), "\n";
  15. if ($time > $timestart && $time < $timeend) {
  16.     echo "работает!";
  17. } else {
  18.     echo "закрыто!";
  19. }
  20.  
  21.  
File Description
  • Мое
  • PHP Code
  • 21 Apr-2022
  • 488 Bytes
You can Share it: