Most programmers have been plagued by the problem of how to implement the code for converting Chinese characters to location codes in PHP. the following source code example can be of great help to everyone. The reference content is as follows :? Phpglobal $ PHP_SELF; echo $ PHP_SELF; $ t1 $ _ POST [textfield1, the following source code example can be of great help to everyone.
Reference content is as follows: Global $ PHP_SELF; // Echo $ PHP_SELF; $ T1 = $ _ POST ['textfield1']; $ T2 = $ _ POST ['textfield2']; $ T3 = $ _ POST ['textfield3']; $ T4 = $ _ POST ['textfield4 ']; // Chinese character -- Location Code If ($ t1! = ""){ $ T2 = sprintf ("% 02d % 02d", ord ($ t1 [0])-160, ord ($ t1 [1])-160 ); // Echo $ t2; } // Location Code-Chinese characters If ($ t3! = ""){ $ T4 = chr (substr ($ t3, 160) + 160). chr (substr ($ t3,) + ); // Echo $ t4; } ?> Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd>
Untitled Document
Align = "center" cellpadding = "0" cellspacing = "0">
|
Class = "STYLE1"> Chinese character location code query system |
|