utf-8格式字符串截取
function utf8Substr($str, $from, $len){
return preg_replace('#^(?:[x00-x7F]|[xC0-xFF][x80-xBF]+)
{0,'.$from.'}'.'((?:[x00-x7F]|[xC0-xFF][x80-xBF]+)
{0,'.$len.'}).*#s','$1',$str);
}
empty the hills, no man in sight, yet voices echo here!
没有评论:
发表评论