Copy CodeThe code is as follows:
Global $PHP _self;
echo $PHP _self;
$t 1=$_post[' textfield1 '];
$t 2=$_post[' textfield2 '];
$t 3=$_post[' textfield3 '];
$t 4=$_post[' Textfield4 '];
Chinese characters--Location code
if ($t 1!= "") {
$t 2= sprintf ("%02d%02d", Ord ($t 1[0]) -160,ord ($t 1[1])-160);
echo $t 2;
}
Location code--Chinese characters
if ($t 3!= "") {
$t 4 = Chr (substr ($t 3,0,2) +160). Chr (substr ($t 3,2,2) +160);
Echo $t 4;
}
?>
"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 |
|
The above introduces the location code input method in PHP to implement the Chinese character to location code application source code example, including the location code input method Aspects of the content, I hope that the PHP tutorial interested friends helpful.