试试:<?php
//例
$text='中文abc
';$text=preg_replace('/\r?\n/','',$text);
$text=preg_replace('/['.chr(0xa1).'-'.chr(0xff).']{2}/','s',$text);
echo strlen($text);
?>未测
//例
$text='中文abc
';$text=preg_replace('/\r?\n/','',$text);
$text=preg_replace('/['.chr(0xa1).'-'.chr(0xff).']{2}/','s',$text);
echo strlen($text);
?>未测
/\r?\n/g,"\r\n"郁闷阿