南强小屋 Design By 杰米
复制代码 代码如下:
<?
function pykey( $py_key)
{
$pinyin = 65536 + pys($py_key);
if ( 45217 <= $pinyin && $pinyin <= 45252 )
{
$zimu = "A";
return $zimu;
}
if ( 45253 <= $pinyin && $pinyin <= 45760 )
{
$zimu = "B";
return $zimu;
}
if ( 45761 <= $pinyin && $pinyin <= 46317 )
{
$zimu = "C";
return $zimu;
}
if ( 46318 <= $pinyin && $pinyin <= 46825 )
{
$zimu = "D";
return $zimu;
}
if ( 46826 <= $pinyin && $pinyin <= 47009 )
{
$zimu = "E";
return $zimu;
}
if ( 47010 <= $pinyin && $pinyin <= 47296 )
{
$zimu = "F";
return $zimu;
}
if ( 47297 <= $pinyin && $pinyin <= 47613 )
{
$zimu = "G";
return $zimu;
}
if ( 47614 <= $pinyin && $pinyin <= 48118 )
{
$zimu = "H";
return $zimu;
}
if ( 48119 <= $pinyin && $pinyin <= 49061 )
{
$zimu = "J";
return $zimu;
}
if ( 49062 <= $pinyin && $pinyin <= 49323 )
{
$zimu = "K";
return $zimu;
}
if ( 49324 <= $pinyin && $pinyin <= 49895 )
{
$zimu = "L";
return $zimu;
}
if ( 49896 <= $pinyin && $pinyin <= 50370 )
{
$zimu = "M";
return $zimu;
}
if ( 50371 <= $pinyin && $pinyin <= 50613 )
{
$zimu = "N";
return $zimu;
}
if ( 50614 <= $pinyin && $pinyin <= 50621 )
{
$zimu = "O";
return $zimu;
}
if ( 50622 <= $pinyin && $pinyin <= 50905 )
{
$zimu = "P";
return $zimu;
}
if ( 50906 <= $pinyin && $pinyin <= 51386 )
{
$zimu = "Q";
return $zimu;
}
if ( 51387 <= $pinyin && $pinyin <= 51445 )
{
$zimu = "R";
return $zimu;
}
if ( 51446 <= $pinyin && $pinyin <= 52217 )
{
$zimu = "S";
return $zimu;
}
if ( 52218 <= $pinyin && $pinyin <= 52697 )
{
$zimu = "T";
return $zimu;
}
if ( 52698 <= $pinyin && $pinyin <= 52979 )
{
$zimu = "W";
return $zimu;
}
if ( 52980 <= $pinyin && $pinyin <= 53640 )
{
$zimu = "X";
return $zimu;
}
if ( 53689 <= $pinyin && $pinyin <= 54480 )
{
$zimu = "Y";
return $zimu;
}
if ( 54481 <= $pinyin && $pinyin <= 62289 )
{
$zimu = "Z";
return $zimu;
}
$zimu = $py_key;
return $zimu;
}
function pys( $pysa )
{
$pyi = "";
$i= 0;
for ( ; $i < strlen( $pysa ); $i++)
{
$_obfuscate_8w= ord( substr( $pysa,$i,1) );
if ( 160 < $_obfuscate_8w)
{
$_obfuscate_Bw = ord( substr( $pysa, $i++, 1 ) );
$_obfuscate_8w = $_obfuscate_8w * 256 + $_obfuscate_Bw - 65536;
}
$pyi.= $_obfuscate_8w;
}
return $pyi;
}
$letter = pykey("中华人民共和国");
echo $letter;
?>
<?
function pykey( $py_key)
{
$pinyin = 65536 + pys($py_key);
if ( 45217 <= $pinyin && $pinyin <= 45252 )
{
$zimu = "A";
return $zimu;
}
if ( 45253 <= $pinyin && $pinyin <= 45760 )
{
$zimu = "B";
return $zimu;
}
if ( 45761 <= $pinyin && $pinyin <= 46317 )
{
$zimu = "C";
return $zimu;
}
if ( 46318 <= $pinyin && $pinyin <= 46825 )
{
$zimu = "D";
return $zimu;
}
if ( 46826 <= $pinyin && $pinyin <= 47009 )
{
$zimu = "E";
return $zimu;
}
if ( 47010 <= $pinyin && $pinyin <= 47296 )
{
$zimu = "F";
return $zimu;
}
if ( 47297 <= $pinyin && $pinyin <= 47613 )
{
$zimu = "G";
return $zimu;
}
if ( 47614 <= $pinyin && $pinyin <= 48118 )
{
$zimu = "H";
return $zimu;
}
if ( 48119 <= $pinyin && $pinyin <= 49061 )
{
$zimu = "J";
return $zimu;
}
if ( 49062 <= $pinyin && $pinyin <= 49323 )
{
$zimu = "K";
return $zimu;
}
if ( 49324 <= $pinyin && $pinyin <= 49895 )
{
$zimu = "L";
return $zimu;
}
if ( 49896 <= $pinyin && $pinyin <= 50370 )
{
$zimu = "M";
return $zimu;
}
if ( 50371 <= $pinyin && $pinyin <= 50613 )
{
$zimu = "N";
return $zimu;
}
if ( 50614 <= $pinyin && $pinyin <= 50621 )
{
$zimu = "O";
return $zimu;
}
if ( 50622 <= $pinyin && $pinyin <= 50905 )
{
$zimu = "P";
return $zimu;
}
if ( 50906 <= $pinyin && $pinyin <= 51386 )
{
$zimu = "Q";
return $zimu;
}
if ( 51387 <= $pinyin && $pinyin <= 51445 )
{
$zimu = "R";
return $zimu;
}
if ( 51446 <= $pinyin && $pinyin <= 52217 )
{
$zimu = "S";
return $zimu;
}
if ( 52218 <= $pinyin && $pinyin <= 52697 )
{
$zimu = "T";
return $zimu;
}
if ( 52698 <= $pinyin && $pinyin <= 52979 )
{
$zimu = "W";
return $zimu;
}
if ( 52980 <= $pinyin && $pinyin <= 53640 )
{
$zimu = "X";
return $zimu;
}
if ( 53689 <= $pinyin && $pinyin <= 54480 )
{
$zimu = "Y";
return $zimu;
}
if ( 54481 <= $pinyin && $pinyin <= 62289 )
{
$zimu = "Z";
return $zimu;
}
$zimu = $py_key;
return $zimu;
}
function pys( $pysa )
{
$pyi = "";
$i= 0;
for ( ; $i < strlen( $pysa ); $i++)
{
$_obfuscate_8w= ord( substr( $pysa,$i,1) );
if ( 160 < $_obfuscate_8w)
{
$_obfuscate_Bw = ord( substr( $pysa, $i++, 1 ) );
$_obfuscate_8w = $_obfuscate_8w * 256 + $_obfuscate_Bw - 65536;
}
$pyi.= $_obfuscate_8w;
}
return $pyi;
}
$letter = pykey("中华人民共和国");
echo $letter;
?>
标签:
PHP,提取,中文首字母
南强小屋 Design By 杰米
广告合作:本站广告合作请联系QQ:858582 申请时备注:广告合作(否则不回)
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件! 如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件! 如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
南强小屋 Design By 杰米
暂无PHP提取中文首字母的评论...
稳了!魔兽国服回归的3条重磅消息!官宣时间再确认!
昨天有一位朋友在大神群里分享,自己亚服账号被封号之后居然弹出了国服的封号信息对话框。
这里面让他访问的是一个国服的战网网址,com.cn和后面的zh都非常明白地表明这就是国服战网。
而他在复制这个网址并且进行登录之后,确实是网易的网址,也就是我们熟悉的停服之后国服发布的暴雪游戏产品运营到期开放退款的说明。这是一件比较奇怪的事情,因为以前都没有出现这样的情况,现在突然提示跳转到国服战网的网址,是不是说明了简体中文客户端已经开始进行更新了呢?