Remove specific words from a string


/ Published in: PHP
Save to your folder(s)

Remove specific words from a string


Copy this code and paste it in your HTML
  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


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.