fork download
  1. <?php
  2.  
  3. function removeCaracteres($str){
  4.  
  5. return str_replace(array(".", "-", "/", "(", ")"), "", $str);
  6.  
  7. }
  8.  
  9. $cpfBd="111.222.333-44";
  10.  
  11. echo removeCaracteres($cpfBd);
  12.  
  13. echo"\n";
  14.  
  15. $celularBd="(21)9876-5432";
  16.  
  17. echo removeCaracteres($celularBd);
Success #stdin #stdout 0.01s 82880KB
stdin
Standard input is empty
stdout
11122233344
2198765432