) {
$s =iconv ("UTF-8", "gb2312", $s 0);
$asc =ord ($s {0}) *256+ord ($s {1})-65536;
if ($asc >=-20319 and $asc
if ($asc >=-20283 and $asc
if ($asc >=-19218 and $asc
if ($
is an iterative process of continuous improvement, in the software development process, small and medium IT enterprises, according to their own resources, especially the development team's human resources, SDLC can be divided into the following four phases from the perspective of accelerating development, ensuring product quality, and facilitating communication and coordination with customers: requirement Analysis, software implementation, system deployment, and system maintenance. 1. The divis
Provides various official and user-released code examples and code reference. You are welcome to exchange and learn.
// Obtain the first letter of the fieldFunction getfirstchar ($ s0 ){$ Fchar = ord ($ s0 {0 });If ($ fchar> = ord ("A") and $ fchar $ S1 = iconv ("UTF-8", "gb2312", $ s0 );$ S2 = iconv ("gb2312", "UTF-8", $ s1 );If ($ s2 = $ s0) {$ s = $ s1;} else {$ s = $ s0 ;}$ Asc = ord ($ s {0}) * 256 + ord ($ s {1})-65536;If ($
Use PHP to extract Chinese and English words and numbers. There is a need for a recent project to extract the first letter of each word in a massive dictionary of Chinese and English (including Arabic numerals 0-9: gannicus-G free-Z2B--E silly recently Project has a demand, in a Chinese and English (including Arabic numerals 0-9) massive dictionary, extract the first letter of each word:
Gannicus --> G
Free --> Z
2B --> E
Silly X --> S
The code is as follows:
Private function getfirstchar ($ s
PHP generates a letter prefix
[PHP] code
Function ff_letter_first ($ s0 ){
$ Firstchar_ord = ord (strtoupper ($ s0 {0 }));
If ($ firstchar_ord> = 65 and $ firstchar_ord
$ S = iconv ("UTF-8", "gb2312", $ s0 );
$ Asc = ord ($ s {0}) * 256 + ord ($ s Beckham)-65536;
If ($ asc >=- 20319 and $ asc
If ($
There is a need for a recent project to extract the first letter of each word in a massive Dictionary of Chinese and English (including arabic numerals 0-9:
Gannicus --> G
Free --> Z
2B --> E
Silly X --> SCopy codeThe Code is as follows:Private function getfirstchar ($ s0 ){$ S = iconv ('utf-8', 'gb2312', $ s0 );If (ord ($ s0)> 128) {// starts with a Chinese character$ Asc = ord ($ s {0}) * 256 + ord ($ s {1})-65536;If ($
: This article mainly introduces the function of extracting the first letter of a string (including Chinese characters) from php. if you are interested in the PHP Tutorial, refer to it.
// Retrieve the initial 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; // conversion not required$ Asc = ord ($ s {0}) * 256 + ord ($ s {1})-65536;
A recent project has a requirement to extract the first letter of each word in a Chinese-English (including Arabic numerals 0-9) Sea-quantifier library:
Gannicus-->g
Free-->z
2b-->e
Silly X-->s.Copy CodeThe code is as follows:Private function Getfirstchar ($s 0) {$s =iconv (' UTF-8 ', ' gb2312 ', $s 0);if (Ord ($s 0) >128) {//Kanji start$asc =ord ($s {0}) *256+ord ($s {1})-65536;if ($asc >=-20319 and $
PHP Gets the first letter function of Chinese pinyinTransfer from www.54dev.com
/** * @param unknown_type $str * @return 取得汉字的首字母 */function getfirstchar($str){ $fchar=$str[0]; //判断是否为字符串 if(ord($fchar)-->=ord ("A") Ord ($fchar)
Return Strtoupper ($fchar);
$str =iconv ("UTF-8", "gb2312", $str);
$ASC =ord ($str [0]) *256+ord ($str [1])-65536;
if ($asc >=-20319 and
PHP get Pinyin First letter
After the program runs, it is found that some text in the string cannot be converted. If you enter these words individually, you can read and remove the phonetic opening letters directly by converting them.
It doesn't work in a string. The program code is as follows:
function Getfirstchar ($s 0) {
$fchar = Ord ($s 0{0});
if ($fchar >= ord ("a") and $fchar
$s 1 = iconv ("UTF-8", "gb2312", $s 0);
$s 2 = iconv ("gb2312", "UTF-8", $s 1);
if ($s 2 = = $s 0) {
Let's take a look at how to get the first letter of a single Chinese character. See the following function. It supports GBK and UTF8 encoding: The code is as follows:Copy code Function getfirstchar ($ s0 ){$ Fchar = ord ($ s0 {0 });If ($ fchar> = ord ("A") and $ fchar $ S1 = iconv ("UTF-8", "gb2312", $ s0 );$ S2 = iconv ("gb2312", "UTF-8", $ s1 );If ($ s2 = $ s0) {$ s = $ s1;} else {$ s = $ s0 ;}$ Asc
Mysql to query the first letter of Chinese Pinyin which man to me mysql to query the first letter of Chinese Pinyin can use, http://topic.csdn.net/u/20090611/17/7579BB9A-0A7C-4460-A302-10BAE7F4A9C5.html,functiongetfirstchar ($ s mysql to query the first letter of Chinese Pinyin)
Which of the following heroes can use mysql to query the first letter of Chinese characters?
------ Solution --------------------
Http://topic.csdn.net/u/20090611/17/7579BB9A-0A7C-4460-A302-10BAE7F4A9C5.html
------ Solu
function Getfirstchar ($s 0) {
$fchar = Ord (substr ($s 0, 0, 1));
if ($fchar >= ord ("a") and $fchar
$s = Iconv ("UTF-8", "gb2312", $s 0);
$ASC = Ord ($s {0}) * n + ord ($s Beckham)-65536;
if ($asc >= -20319 and $asc
if ($asc >= -20283 and $asc
How to obtain the first letter of a group of Chinese characters and Pinyin using python
This example describes how to obtain the first letter of a group of Chinese Characters in python. Share it with you for your reference. The specific implementation method is as follows:
?
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 7
A recent project has a need to extract the initials of each word in a sea classifier of Chinese and English (including Arabic numeral 0-9):
Gannicus-->g
Free-->z
2b-->e
Silly X-->s
Copy Code code as follows:
Private function Getfirstchar ($s 0) {
$s =iconv (' UTF-8 ', ' gb2312 ', $s 0);
if (Ord ($s 0) >128) {//Kanji start
$asc =ord ($s {0}) *256+ord ($s {1})-65536;
if ($asc >=-20319 and $
($s 0) {
$s =iconv ("UTF-8", "gb2312", $s 0);
$asc =ord ($s {0}) *256+ord ($s {1})-65536;
if ($asc >=-20319 and $asc
if ($asc >=-20283 and $asc
if ($asc >=-19218 and $asc
if (
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.