#1 xpp1000
function utf8shtml($params){$str=$params["str"];
$str = trim($str);
$str = strip_tags($str,"");
$str = ereg_replace("\t","",$str);
$str = ereg_replace("\r\n","",$str);
$str = ereg_replace("\r","",$str);
$str = ereg_replace("\n","",$str);
$str = ereg_replace(" "," ",$str);
$from=$params["from"];
$len=$params["len"];
return preg_replace('^(?:[\x00-\x7F]|[\xC0-\xFF][\x80-\xBF]+){0,'.$from.'}'.
'((?:[\x00-\x7F]|[\xC0-\xFF][\x80-\xBF]+){0,'.$len.'}).*s',
'$1',$str);
}
spAddViewFunction('utf8shtml','utf8shtml');
2011-05-30 16:04:28