Analysis of source code application examples for converting Chinese characters to location codes in PHP_PHP tutorial

WBOY
Release: 2016-07-21 15:37:21
Original
746 people have browsed it

Copy code The code is as follows:

global $PHP_SELF;
//echo $PHP_SELF;
$t1=$_POST['textfield1'];
$t2=$_POST['textfield2'];
$t3=$_POST['textfield3'];
$t4=$_POST[ 'textfield4'];
//Chinese characters--location code
if($t1!=""){
$t2= sprintf("%02d%02d",ord($t1[0] )-160,ord($t1[1])-160);
//echo $t2;
}
// Area code--Chinese characters
if($t3!="" ){
$t4 = chr(substr($t3,0,2)+160).chr(substr($t3,2,2)+160);
//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
"">


< label>






< label>Input location code


< input type="submit" name="Submit2" value=" Convert" />




www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/321962.htmlTechArticleCopy the code as follows: ?php global $PHP_SELF; //echo $PHP_SELF; $t1=$_POST[' textfield1']; $t2=$_POST['textfield2']; $t3=$_POST['textfield3']; $t4=$_POST['textfield4']; // Chinese characters...
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!