fork(1) download
  1. <?php
  2.  
  3. $text = "+7-9- 434 -67 5 6";
  4. $regexp = '/[-)( ]/';
  5. $regexp1 = '/[+7]/';
  6. $result =preg_replace($regexp1,"8",$text);
  7. $result2 =preg_replace($regexp,"",$result);
  8. echo $result2;
  9.  
  10.  
Success #stdin #stdout 0.02s 52480KB
stdin
Standard input is empty
stdout
    8894346856