首页 php教程 php手册 获取汉字拼音首字母大写

获取汉字拼音首字母大写

Jun 07, 2016 am 11:45 AM

获取汉字首字母大写
function get_letter($string) {<br>     $charlist = mb_str_split($string);<br>     return implode(array_map("getfirstchar", $charlist));<br> } <br> function mb_str_split($string) {<br>     // Split at all position not after the start: ^<br>     // and not before the end: $<br>     return preg_split('/(? }<br> <br> function getfirstchar($s0) {<br>     $fchar = ord(substr($s0, 0, 1));<br>     if (($fchar &gt;= ord("a") and $fchar = ord("A") and $fchar      $s = iconv("UTF-8", "GBK", $s0);<br>     $asc = ord($s{0}) * 256 + ord($s{1})-65536;<br>     if ($asc &gt;= -20319 and $asc      if ($asc &gt;= -20283 and $asc      if ($asc &gt;= -19775 and $asc      if ($asc &gt;= -19218 and $asc      if ($asc &gt;= -18710 and $asc      if ($asc &gt;= -18526 and $asc      if ($asc &gt;= -18239 and $asc      if ($asc &gt;= -17922 and $asc      if ($asc &gt;= -17417 and $asc      if ($asc &gt;= -16474 and $asc      if ($asc &gt;= -16212 and $asc      if ($asc &gt;= -15640 and $asc      if ($asc &gt;= -15165 and $asc      if ($asc &gt;= -14922 and $asc      if ($asc &gt;= -14914 and $asc      if ($asc &gt;= -14630 and $asc      if ($asc &gt;= -14149 and $asc      if ($asc &gt;= -14090 and $asc      if ($asc &gt;= -13318 and $asc      if ($asc &gt;= -12838 and $asc      if ($asc &gt;= -12556 and $asc      if ($asc &gt;= -11847 and $asc      if ($asc &gt;= -11055 and $asc      return null;<br> } 

AD:真正免费,域名+虚机+企业邮箱=0元

本站声明
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn

热门文章

仓库:如何复兴队友
3 周前 By 尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island冒险:如何获得巨型种子
3 周前 By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O.能量晶体解释及其做什么(黄色晶体)
1 周前 By 尊渡假赌尊渡假赌尊渡假赌

热门文章

仓库:如何复兴队友
3 周前 By 尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island冒险:如何获得巨型种子
3 周前 By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O.能量晶体解释及其做什么(黄色晶体)
1 周前 By 尊渡假赌尊渡假赌尊渡假赌

热门文章标签

记事本++7.3.1

记事本++7.3.1

好用且免费的代码编辑器

SublimeText3汉化版

SublimeText3汉化版

中文版,非常好用

禅工作室 13.0.1

禅工作室 13.0.1

功能强大的PHP集成开发环境

Dreamweaver CS6

Dreamweaver CS6

视觉化网页开发工具

SublimeText3 Mac版

SublimeText3 Mac版

神级代码编辑软件(SublimeText3)

了解Python编程的入门级代码示例 了解Python编程的入门级代码示例 Jan 04, 2024 am 10:50 AM

了解Python编程的入门级代码示例

如何使用PHP编写库存管理系统中的库存分仓管理功能代码 如何使用PHP编写库存管理系统中的库存分仓管理功能代码 Aug 06, 2023 pm 04:49 PM

如何使用PHP编写库存管理系统中的库存分仓管理功能代码

PHP 变量的实际应用:10 个实际使用示例 PHP 变量的实际应用:10 个实际使用示例 Feb 19, 2024 pm 03:00 PM

PHP 变量的实际应用:10 个实际使用示例

Go语言编程实例:Web开发中的代码示例 Go语言编程实例:Web开发中的代码示例 Mar 04, 2024 pm 04:54 PM

Go语言编程实例:Web开发中的代码示例

Java实现简单的冒泡排序代码 Java实现简单的冒泡排序代码 Jan 30, 2024 am 09:34 AM

Java实现简单的冒泡排序代码

从入门到精通:Go语言中常用数据结构的代码实现 从入门到精通:Go语言中常用数据结构的代码实现 Mar 04, 2024 pm 03:09 PM

从入门到精通:Go语言中常用数据结构的代码实现

华为云边缘计算对接指南:Java代码示例快速实现接口 华为云边缘计算对接指南:Java代码示例快速实现接口 Jul 05, 2023 pm 09:57 PM

华为云边缘计算对接指南:Java代码示例快速实现接口

指导与示例:学习Java选择排序算法的实现 指导与示例:学习Java选择排序算法的实现 Feb 18, 2024 am 10:52 AM

指导与示例:学习Java选择排序算法的实现

See all articles