Home >Backend Development >PHP Tutorial >PHP function to remove the first letter of a string (including Chinese characters)
//Get the first letter function
function getfirstchar($s0){
if(ord($s0)>="1" and ord($s0)//$s=iconv("UTF-8", "gb2312", $s0); If you need to convert to utf-8
$s=$s0;//No need Conversion situation
$asc=ord($s{0})*256+ord($s{1})-65536;
if($asc>=-20319 and $ascif($asc>=-20283 and $ascif($asc>=-19775 and $ascif($asc> ;=-19218 and $ascif($asc>=-18710 and $ascif($asc>=-18526 and $ ascif($asc>=-18239 and $ascif($asc>=-17922 and $ascif($asc>=-17417 and $asc if($asc>=-16212 and $ascIF ($ ASC & GT; = -14630 and $ ASC & LT; = -14150) Return "q";
if ($ asc & gt; =-14149 and $ asc & lt; =-1409111140911 ) Return " R"; "
if( $asc>=-12838 and $ascif($asc>=-11055 and $asc
?>
The above introduces the PHP function for extracting the first letter of a string (including Chinese characters), including the relevant content. I hope it will be helpful to friends who are interested in PHP tutorials.