<?
$tit="一二三四五六七八";
$pack="";
$cnt=10; //擷取的字串數
for($x=0;$x<strlen($tit);$x++)
{
if(ord(substr($tit,$x,1))>128)
{
$pack=$pack.substr($tit,$x,2);
$x++;
}Else{
$pack=$pack.substr($tit,$x,1);
}
$cnt--;
if($cnt<=0)
Break;
}
echo "$pack..."
?>
試試這是不是你要的^^
|