日期:2013-12-28  浏览次数:20512 次

    function SubstrGB($in,$num){
        $pos=0;
        $out="";
        while($c=substr($in,$pos,1)){
            if($c=="\n") break;
            if(ord($c)>128){
                $out.=$c;
                $pos++;
                $c=substr($in,$pos,1);
                $out.=$c;
            }
            else{
                $out.=$c;
            }
            $pos++;
            if($pos>=$num) break;
        }
        return $out;
    }