北极鸥

中文转拼音

 160) {
                $_ord = ord(substr($str, ++$i, 1));
                $ord = $ord * 256 + $_ord - 65536;
            }
            $res .= self::__toPinyin($ord, self::$__data);
        }
        return preg_replace("/[^a-z0-9]*/", '', $res);
    }

    private static function __toPinyin($num, $data) {
        if ($num > 0 && $num < 160) {
            return chr($num);
        } elseif ($num < -20319 || $num > -10247) {
            return '';
        } else {
            foreach ($data as $k => $v) {
                if ($v <= $num)
                    break;
            }
            return $k;
        }
    }

    private static function utf8ToGBK($c) {
        $str = '';
        if ($c < 0x80) {
            $str .= $c;
        } elseif ($c < 0x800) {
            $str .= chr(0xC0 | $c >> 6);
            $str .= chr(0x80 | $c & 0x3F);
        } elseif ($c < 0x10000) {
            $str .= chr(0xE0 | $c >> 12);
            $str .= chr(0x80 | $c >> 6 & 0x3F);
            $str .= chr(0x80 | $c & 0x3F);
        } elseif ($c < 0x200000) {
            $str .= chr(0xF0 | $c >> 18);
            $str .= chr(0x80 | $c >> 12 & 0x3F);
            $str .= chr(0x80 | $c >> 6 & 0x3F);
            $str .= chr(0x80 | $c & 0x3F);
        }
        return iconv('UTF-8', 'GB2312', $str);
    }

}

?>

15262

15262:香港赛马会官方网址www.smh0022.top为迎接祖国67周年庆,即日起注册即送38。更有电子游艺七部曲,到处是惊喜,邀您来战

2016-10-02 20:00:00回复

行者

行者:?

2015-11-12 16:48:21回复


京ICP备12040723号 关于易寻 联系我们 手机版