fork download
  1. <?php
  2. $s = '+7 777 777777';
  3. $pattern = '/^\+[0-9]{1,3}\s[0-9]{1,6}\s[0-9\s]{5,8}$/u';
  4. echo preg_match($pattern, $s);
  5. ?>
Success #stdin #stdout 0.01s 13112KB
stdin
Standard input is empty
stdout
1