PHP implementation of Chinese character location code application source code example _ PHP Tutorial

Source: Internet
Author: User
PHP implements parsing of the source code of the conversion code of Chinese characters. Copy the code as follows :? Phpglobal $ PHP_SELF; echo $ PHP_SELF; $ t1 $ _ POST [textfield1]; $ t2 $ _ POST [textfield2]; $ t3 $ _ POST [textfield3]; $ t4 $ _ POST [textfield4]; Chinese characters 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








The http://www.bkjia.com/PHPjc/321962.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/321962.htmlTechArticle code is as follows :? Php global $ PHP_SELF; // echo $ PHP_SELF; $ t1 =$ _ POST ['textfield1']; $ t2 =$ _ POST ['textfield2']; $ t3 = $ _ POST ['textfield3 ']; $ t4 = $ _ POST ['textfield4']; // Chinese characters...

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.