PHP开发中如何获取英文首字母
来源:爱站网时间:2020-11-11编辑:网友分享
在PHP开发中,有时候我们需要获取文章中的中文首字母进行展示,这个时候我们要怎么操作呢?别着急,下面是爱站技术频道小编带给大家的PHP开发中如何获取英文首字母,希望能为你带来帮助。
在PHP开发中,有时候我们需要获取文章中的中文首字母进行展示,这个时候我们要怎么操作呢?别着急,下面是爱站技术频道小编带给大家的PHP开发中如何获取英文首字母,希望能为你带来帮助。
PHP开发中如何获取英文首字母
/**
*
*/
function getfirstchar($s0){
if($s0[0]=='I' || $s[0]=='i'){
return "I";
}elseif($s0[0]=='U' || $s[0]=='u'){
return 'U';
}elseif($s0[0]=='V' || $s[0]=='v'){
return 'V';
}else{
$fchar = ord($s0{0});
if($fchar >= ord("A") and $fchar = -20319 and $asc = -20283 and $asc = -19775 and $asc = -19218 and $asc = -18710 and $asc = -18526 and $asc = -18239 and $asc = -17922 and $asc = -17417 and $asc = -16474 and $asc = -16212 and $asc = -15640 and $asc = -15165 and $asc = -14922 and $asc = -14914 and $asc = -14630 and $asc = -14149 and $asc = -14090 and $asc = -13318 and $asc = -12838 and $asc = -12556 and $asc = -11847 and $asc = -11055 and $asc
以上就是爱站技术频道小编给大家推荐的PHP开发中如何获取英文首字母,希望诸多程序员能够从中获得需要的内容,也希望能一如既往的支持我们哟。
上一篇:如何使用PHP方法核算目录大小
