Posted By

pruntrut on 05/23/12


Tagged

php String


Versions (?)

Remove specific words from a string


 / Published in: PHP
 

Remove specific words from a string

  1. function stripCp($string )
  2. {
  3. $wordlist = array("CP", "case", "postale","Case","Postale","cp");
  4. foreach($wordlist as $word)
  5. {
  6. $string = str_replace($word, "", $string);
  7. }
  8. return $string;
  9. }

Report this snippet  

You need to login to post a comment.