/** * 去除html标签和空格回车等 * @param $string * @return string */ function cutstr_html($string){ $string = strip_tags($string); $string = trim($string); $string = str_replace(["\t", "\r\n", "\r", "\n", " "], ‘‘, $string); $string = preg_replace(‘/\s+|\t+/u‘, ‘‘, $string); return $string; }