fork(1) download
  1. <?php
  2.  
  3. function match($mask, $name) {
  4. $pattern = mb_substr($mask, 0, 1);
  5. $tested = mb_substr($name, 0, 1);
  6.  
  7. if(!empty($tested) and !empty($pattern)) {
  8.  
  9. if($pattern == $tested) {
  10. $mask = mb_substr($mask, 1);
  11. $name = mb_substr($name, 1);
  12. return match($mask, $name);
  13. } else {
  14. return false;
  15. }
  16.  
  17. } elseif (empty($tested) and empty($patten)) {
  18. return true;
  19. } else {
  20. return false;
  21. }
  22.  
  23. }
  24.  
  25. $a = match(тест1, тест);
  26.  
Success #stdin #stdout #stderr 0.01s 24448KB
stdin
Standard input is empty
stdout
bool(true)
stderr
PHP Notice:  Use of undefined constant тест1 - assumed 'тест1' in /home/uHyhaw/prog.php on line 26
PHP Notice:  Use of undefined constant тест - assumed 'тест' in /home/uHyhaw/prog.php on line 26