PHP function to filter html code spaces and carriage returns and line feeds
/** * PHP function to filter HTML code spaces, carriage returns and line feeds * echo deletehtml()- */
- function deletehtml($str)
- {
- $str = trim($str);
- $str=strip_tags($str,"");
- $str=preg_replace( "{t}","",$str);
- $str=preg_replace("{rn}","",$str);
- $str=preg_replace("{r}","",$str) ;
- $str=preg_replace("{n}","",$str);
- $str=preg_replace("{ }","",$str);
- return $str;
- }
-
-
- Copy code
|