This is a class that is packed with classes,
Two other table files are required:
1. Http://www.jerry.com.tw/php/big5.map
2. Http://www.jerry.com.tw/php/gb.map
The program is as follows: CCHARSET.PHP3
? //=====================================================
Programmer: Magic Jerry
//
function Big5_gb ($str) => Big5 Gb for string
function Gb_big5 ($str) => Gb Big5 for string
//=====================================================
Class Ccharset {
var $gb _map= "Gb.map"; If you want to put the other path, add the full path
var $big 5_map= "Big5.map"; For example = "/home/table/gb.map
var $dep _char = 127;
//-----------------------------------------------------------------
function Cbig5_gb ($STR, $FD) {
===================================================================
Use examples:
?
Designer:magic Jerry.
= = = Direct conversion of the use of text strings ========
Include ("ccharset.php3");
$obj =new Ccharset;
$big 5 = "This is a Big5 text string";
$TGB = $obj->BIG5_GB ($big 5);
Echo $TGB; ===> $TGB for a converted GB code string.
$tbig 5= $obj->gb_big5 ($TGB);
echo $tbig 5; Has been turned back: Big5
//======================================
?>
?
If you switch directly to the Web or file,
The language http://your.domain.com.tw/this program. php3?http://URL or file to be encoded
Example: Convert qi Mo homepage
http://your.domain.com.tw/this program. php3?http://www.kimo.com.tw/index.shtml
Note: The following notation may be kicked back, login error, if you encounter a cookie on the Web page, such as user verification.
Why? Think about it ... @_@
Include ("ccharset.php3");
$file = $QUERY _string;
$fcontents = Join (' ", File (" $file "));
$fcontents =str_replace ("$code =new Ccharset;
$GB = $code->BIG5_GB ($fcontents);
Echo $GB;
?>
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.