过滤掉回车 换行 \n\r <br />

XML/HTML代码
  1. /**   
  2.  * 过滤掉回车...   
  3.  */   
  4. function cut_br($content,$replace=''){   
  5.     while(ereg(chr(10),$content))   {   
  6.         $tmp1=substr($content,0,(strpos($content,chr(10))-1)).$replace;   
  7.         $tmp2=substr($content,(strpos($content,chr(10))+1));   
  8.         $content=$tmp1.$tmp2;   
  9.     }   
  10.     if(strlen($content) > 40) $content = str_replace(' ','',$content);   
  11.     return $content;   
  12. }  

« 上一篇 | 下一篇 »

发表评论

评论内容 (必填):