fork(1) download
  1. <?php
  2.  
  3. $input = "8-495-1-234-567";
  4. $regexp = '/^\\+?8?7?\';
  5. $matches = array();
  6.  
  7. if(preg_match($regexp, $input, $matches)){
  8. echo "Все верно.\n";
  9. var_dump($matches);
  10. }else{
  11. echo "Ошибка";
  12. }
Success #stdin #stdout 0.01s 24192KB
stdin
Standard input is empty
stdout
Ошибка