fork download
  1. <?php
  2.  
  3. $str="Apelido:
  4.  
  5.  
  6. Fulano de Tal";
  7.  
  8.  
  9. $str = preg_replace(array('/Apelido/','/:/', '/\s{2,}/', '/[\n\r\t]/',), array("",""," ", " "), $str);
  10.  
  11. $str = trim($str);
  12.  
  13. echo $str;
Success #stdin #stdout 0.01s 82944KB
stdin
Standard input is empty
stdout
Fulano de Tal