Location code Input Method PHP to implement the Chinese character to location code application source code example analysis

Source: Internet
Author: User
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.

  • Contact Us

    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.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.