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.
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 Code 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 |
|