日期:2010-10-23  浏览次数:20410 次


    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;
    }