fork(1) download
  1. <?php
  2.  
  3.  
  4. $numbers =
  5. '84951234567 +74951234567 8-495-1-234-567
  6. 8 (8122) 56-56-56 8-911-1234567 8 (911) 12 345 67
  7. 8-911 12 345 67 8 (911) - 123 - 45 - 67 + 7 999 123 4567
  8. 8 ( 999 ) 1234567 8 999 123 4567
  9. 02 84951234567 позвать люсю 849512345 849512345678
  10. 8 (409) 123-123-123 7900123467 5005005001 8888-8888-88
  11. 84951a234567 8495123456a +1 234 5678901 +8 234 5678901
  12. 7 234 5678901';
  13.  
  14.  
  15. $regexp = "/^\\s?([+]\s*[7]|8)\\W*[0-9]\\W*[0-9]\\W*[0-9]\\W*[0-9]\\W*[0-9]\\W*[0-9]\\W*[0-9]\\W*[0-9]\\W*[0-9]\\W*[0-9]$/";
  16.  
  17. $regexpRepl = "/^\\([+]7)\\d{10}$/";
  18.  
  19. $CorrNumb = array();
  20.  
  21. if(preg_match($regexp, $numbers, $CorrNumb)) {
  22. var_dump($CorrNumb);
  23.  
  24. }
  25.  
  26. $lenght = count($CorrNumb);
  27. echo $lenght;
  28.  
  29.  
  30.  
  31.  
  32. ?>
Success #stdin #stdout 0s 82944KB
stdin
Standard input is empty
stdout
Standard output is empty