Advertisement
Mihail_Atnsv

matchPhoneNumber

Dec 13th, 2018
149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.18 KB | None | 0 0
  1. <?php
  2.  
  3. $pattern = "/( ?\+359 2{1} \d{3} \d{4})|(\+ ?359-2{1}-\d{3}-\d{4}\b)/";
  4. $input = readline();
  5.  
  6. preg_match_all($pattern, $input, $matches);
  7. echo implode(", ", $matches[0]);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement