PHP去除字符串中的html标签

//去除字符串中的html标签
function Bing_string_cleanr( $string ){ 
 $string = trim( $string );  
 $string = strip_tags( $string ); 
 $string = htmlspecialchars( $string, ENT_QUOTES, 'UTF-8' ); 
 $string = str_replace( "n", "", $string ); 
 $string = trim( $string ); 
 return $string; 
}
echo Bing_string_cleanr( '内 容 <br> <html> asdfeiuonsdfje' );
0 Comments
Leave a Reply