1.0 使用以下方法即可
function cutstr_html($string){
$string = trim($string);
$string = preg_replace('/($s*$)|(^s*^)/m', '',$string);
$string = preg_replace("/ /","",$string);
return trim($string);
}