运用PHP实现汉字转区位码应用源码实例解析
PHP里如何实现汉字转区位码这个问题一直困扰这大多程序员,那么下面这个源码实例相信能给大家带来很大的帮助。
以下为引用的内容:
global $PHP_SELF;
//echo $PHP_SELF;
$t1=$_POST[textfield1];
$t2=$_POST[textfield2];
$t3=$_POST[textfield3];
$t4=$_POST[textfield4];
// 汉字--区位码
if($t1!=""){
$t2= sprintf("%02d%02d",ord($t1[0])-160,ord($t1[1])-160);
//echo $t2;
}
// 区位码--汉字
if($t3!=""){
$t4 = chr(substr($t3,0,2)+160).chr(substr($t3,2,2)+160);
//echo $t4;
}
?>
BR> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

MantisBT
Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

Dreamweaver Mac version
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

PhpStorm Mac version
The latest (2018.2.1) professional PHP integrated development tool

WebStorm Mac version
Useful JavaScript development tools