Heim >php教程 >php手册 >php简单的获得汉字的第一个拼音字母

php简单的获得汉字的第一个拼音字母

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-06-06 20:12:521430Durchsuche

php简单的获得汉字的第一个拼音字母的函数: ?phpfunction getFirstChar($string) {$firstCharOrd = ord(strtoupper($string{0}));if (($firstCharOrd = 65 $firstCharOrd = 91) || ($firstCharOrd = 48 $firstCharOrd = 57))return strtoupper($string{0});

php简单的获得汉字的第一个拼音字母的函数:

<?php function getFirstChar($string) {
$firstCharOrd = ord(strtoupper($string{0}));
if (($firstCharOrd >= 65 && $firstCharOrd = 48 && $firstCharOrd =- 20319 && $asc =- 20283 && $asc =- 19775 && $asc =- 19218 && $asc =- 18710 && $asc =- 18526 && $asc =- 18239 && $asc =- 17922 && $asc =- 17417 && $asc =- 16474 && $asc =- 16212 && $asc =- 15640 && $asc =- 15165 && $asc =- 14922 && $asc =- 14914 && $asc =- 14630 && $asc =- 14149 && $asc =- 14090 && $asc =- 13318 && $asc =- 12838 && $asc =- 12556 && $asc =- 11847 && $asc =- 11055 && $asc 
  • 相关:ord() 函数返回字符串第一个字符的 ASCII 值。
Stellungnahme:
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn