Posted By

donkeykong on 10/21/08


html strip String tags remove utility

Versions (?)

Who likes this?

1 person have marked this snippet as a favorite


strip html and amend tabs and spaces

 / Published in: PHP

A function to remove tags and to also remove excess spaces.

  1. function stripTagsAmendSpaces($str)
  2. {
  3. $str = trim($str);
  4. $str= strip_tags($str);
  5. return $str = preg_replace('/\\s{2,}/',' ',$str);
  6. }

Report this snippet  

You need to login to post a comment.