Many websites have the feature of instant, simple, and complex switching, but none of them provide the practice. As a result, I also wrote a conversion program for anyone who needs it:
The table file used by the following program is the big5-gb.table of a4chinese, its copyright is owned by a4chinese; PHP code part can be freely modified application, only cannot sell for profit .. ^
1. Get the big5-gb.table file first, you can find it at the link below the article.
2. Add the following PHP code:
Function big52gb ($ Text ){
$ Fp = fopen ("big5-gb.table", "r ");
$ Max = strlen ($ Text)-1;
For ($ I = 0; $ I <$ max; $ I ++ ){
$ H = ord ($ Text [$ I]);
If ($ h> = 160 ){
$ L = ord ($ Text [$ I + 1]);
If ($ h = 161 & $ l = 64 ){
$ Gb = "";
} Else {
Fseek ($ fp, ($ h-160) * 510 + ($ L-1) * 2 );
$ Gb = fread ($ fp, 2 );
}
$ Text [$ I] = $ gb [0];
$ Text [$ I + 1] = $ gb [1];
$ I ++;
}
}
Fclose ($ fp );
Return $ Text;
}
3. Then you can use it.
$ A = "traditional to simplified ";
$ A = big52gb ($ );
The above code is the simplest method, that is, one by one, and the speed is acceptable. If you want to hurry up, you need to rewrite the method (I am not using this method, however, because my method is still being tested and I still don't know the stability and instability, I haven't written it out yet )... ^