PHP to get Chinese phonetic code
Get phonetic code for Chinese
{$_q = Ord (substr ($chinese, + + $i, 1)), $_p = $_p * + $_q-65536;} $result. = ($ucfirst Ucfirst (Self::_pinyin ($_p, $data)): Self::_pinyin ($_p, $data));} Return Preg_replace ("/[^a-z0-9]*/i", "', $result);} private static function _pinyin ($num, $data) {if ($num > 0 && $num <) return Chr ($num); ElseIf ($num < -20319 | | $num > -10247) return '; Else{foreach ($data as $k = + $v) {if ($v <= $num) break;} return $k;}} private static function _u2_utf8_gb ($c) {$string = "," if ($c < 0x80) $string. = $c; ElseIf ($c < 0x800) {$string. = Chr (0xC0 | $c >> 6); $string. = Chr (0x80 | $c & 0x3F);} ElseIf ($c < 0x10000) {$string. = Chr (0xE0 | $c >>); $string. = Chr (0x80 | $c >> 6 & 0x3F); $string. = Chr (0x80 | $c & 0x3F);} ElseIf ($c < 0x200000) {$string. = Chr (0xF0 | $c >>) $string. = Chr (0x80 | $c >> & 0x3F); $string. = Chr (0x80 | $c >> 6 & 0x3F) $string. = Chr (0x80 | $c & 0x3F);} Return Iconv (' UTF-8 ', ' GB2312 ', $string);}? >
http://www.bkjia.com/PHPjc/847856.html www.bkjia.com true http://www.bkjia.com/PHPjc/847856.html techarticle php get Chinese pinyin code to get Chinese phonetic code 160) {$_q = Ord (substr ($chinese, + + $i, 1)) $_p = $_p * + $_q-65536;} $result. = ($ucfirst Ucfirst (Self::_pinyin ($_p ...