17 марта - 1 - 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 17 марта - 1.php

  1. <?php
  2. $today = date("j.m");
  3. //$today = '10.05';
  4. $week = date("D");
  5. //Праздники.Строго с точкой через запятую и пробел!
  6. $holidays = explode(', ', '1.01, 2.01, 3.03, 7.01, 23.02, 8.03, 1.05, 9.05, 12.06, 4.11');
  7.  
  8. //Допол.выходные 2021.Строго с точкой через запятую пробел!
  9. $offdays = explode(', ', '4.01, 5.01, 6.03, 22.02, 3.05, 10.05, 9.05, 14.06, 31.11');
  10.  
  11. //Рабочие СБ и ВС 2021.Строго с точкой через запятую пробел!
  12. $blackdays =  explode(', ', '20.02');
  13.  
  14. if(in_array($today,$holidays)||in_array($today,$offdays))
  15. {echo "Праздник или доп. вых";} 
  16. elseif (in_array($today,$blackdays))
  17. {echo "Доп. раб. день";}
  18. elseif($week=="Sat"||$week=="Sun")
  19. {echo "Выходной $week $today";}
  20. else
  21. {echo "Рабочий день $week $today";}
  22. ?>
  23.  
File Description
  • 17 марта - 1
  • PHP Code
  • 17 Mar-2021
  • 918 Bytes
You can Share it: