/** * 去除html标签和空格回车等 * @param $string * @return string */ function cutstr_html($string){ $string = strip_tags($string); $string = trim($string); $string = str_replace([" ", " ", " ", " ", " "], '', $string); $string = preg_replace('/s+| +/u', '', $string); return $string; }
以上仅是目前所用