Digital phpupdate Insertion
The combination of PHP and MySQL, for the operation of the number is completely correct, the database table is the property of varchar, the database is also set UTF8, but the problem should not be here, not only
Directly on the instance
Written to hundreds of billions.
/**
* @author ja Ode* Replace the number 1.1 billion with Chinese characters, such as:123-> 123* @param [num] $num [number]* @return [string] [string]*/function Numtoword ($num){$chiNum =
-20319, ' ai ' =>-20317, ' an ' =>-20304, ' ang ' =>-20295, ' ao ' =>-20292, ' ba ' =>-20283, ' Bai ' =>-20265, ' ban ' =>-20257, ' bang ' =>-20242, ' bao ' =>-20230, ' bei ' =>-20051, ' Ben ' =>-20036, ' Beng ' =>-20032, ' bi ' =>- 20026, ' Bian ' =
The example of this article for you to share the PHP character conversion Pinyin function code, for your reference, the specific implementation of the following
= ' 5.0 ')? Array_combine ($_tdatakey, $_tdatavalue): $this->arr_combine
/***
* pinyin.php
* Example:pinyin (' Zhang Honghua ', 1); The second parameter is arbitrarily set to UTF-8 encoding to NULL the default is GB encoding
* edit:bbs.it-home.org
**/
function Pinyin ($_string, $_code= ' gb2
Effect:
Default.aspx
(Verification Code test)
Using System; Using System.Collections.Generic; Using System.Linq; Using System.Web; Using System.Web.UI; Using System.Web.UI.WebControls; Public partial class
1, use the GD library function to generate the picture, and write the specified characters on the pictureImagecreatetruecolor Create a new true color imageImagecolorallocate Assigning color (palette) to an imageImagestring drawing
PHP's conversion of Chinese characters has always been a rather troublesome thing.
The class contains four functions "Htmlhex", "Htmldec", "Escape", "U2utf8"
User-friendly, and customizable functions for your favorite operations
qswhgbk.php Download
For example, Dalian, I converted to Dalian, the letter to convert to D,l to L, and other letters or lowercase
Reply to discussion (solution)
Is there a great God to help solve it? seek to solve
Using the Pinyin.dat comparison chart of the
Sql
MysqlOur MySQL uses the default character set of Latin1, that is, the Chinese character field is stored directly with the encoding of the GBK code, and when some fields with Chinese characters need to be phonetic sorted (especially when a
A few days ago changed the program of a small bug, that is, the length of the input check problem. Project is. NET, the database is SQL Server. Check, found that the previous personnel to the length of the control is small, the database allowed to
version, the CJK Unified Chinese character area is 0x4e00-0x9fa5, which is the 20,902 characters we often refer to. The current version of Unicode adds 22 characters, and the code bit is 0X9FA6-0X9FBB. They are:
So GB18030 supports these 22 characters. It will be discussed later. 2 GB2312
The 1980 GB2312 included a total of 7,445 characters, including 6,763 characters and 682 other symbols. The inner code range of the Chinese character area is high byte from B0-f7, low byte from A1-fe, and the
//1. Use ASCII code to judge//In the ASCII code table, the English range is 0-127, while the kanji is greater than 127, the specific code is as follows:stringText ="is it kanji, ABC, Collayi?"; for(inti =0; I ) { if((int) Text[i] >127) {Console.WriteLine ("It's kanji ."); } Else{Console.WriteLine ("not
It is easy to find this [\u4e00-\u9fa5]when it comes to matching Chinese characters with regular Expressions , but it is not comprehensive and does not contain some rare characters.This article makes a comb about this problem.The following is a more comprehensive Unicode distribution of Chinese characters, as of the Unicode 8.0 standard (June 2015):
Chunk
scope
actual kanji number
regular
CJK Unifi
.
There is indeed a bad habit of reading manuals.
But I just flipped through, and I thought this function could not meet the requirements.
1. how to support multi-dimensional arrays?
2. how can I use it to recursion functions such as iconv ('gbk', 'utf-8', $ str?
This function has never been used, so you may need to write an example.
$ Ar = array ('kanji '), array ('kanji '), array ('
Unicode characters from 1 to 4 bytes, English one byte/1byte (8 bit/8bit), Chinese three bytes/3byte (24 bit/24bit)The length of the ' Chinese ' 2 kanji is 3byte * 2 = 6byteThe length of ' e ' 1 English + 1 kanji is 1byte + 3byte = 4byte' A0 ' 1 English + 1 digit length is 1byte + 1byte = 2byte MySQL Sample code (GBK encoding): --Create a table with the specified GBK encodingCREATE TABLE CHARTESTGBK (fstr
I encountered a problem when I was doing a personal App-caykanji:
How to incrementally update the kanji data from the server to the app side, that is, each time the user runs the update operation, only gets the version number higher than the locally cached content.
Data formatIn order to be able to seamlessly integrate with MongoDB, and eliminate the hassle of writing background code, simply save the Chinese character data into a JS
Author: Bluedoor
Original address: http://www.anbbs.com/anbbs/index.php?f_id=3page=1
These two days are doing a keyword highlighting the program, write a good program in the local test also run well, but a page on a pile of garbage, don't say add light, it is no look!
I find the wrong, find out, find English no problem, encountered Chinese characters prone to problems, sometimes encountered Chinese characters will be a problem.
To summarize:
When using pattern matching, such as: Preg_match_all (
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.