PHP does not use iconv () function UTF8 to GB2312 string encoding.
[color=#FF0000] is downloaded, please unzip the gb2utf8.rar file to get the gb2utf8.txt file and put it in the same directory with your PHP program file. [/color]
[code]
.lt; php
function utf82gb ($utf8)
{
static $utf82gbcodetable;
/ / / / / / / > $codetablefile = file (.Quot; gb2utf8.txt.quot; 1);
$utf82gbcodetable=array ($utf82gbcodetable=array);
while (list ($key, $value)). T;.Quot;; $utf8! = '=';)
{
if (ord (substr ($utf8,0,1)).Gt; 224) {three bytes
$gb. = = > > 127) = > = > = = = > = > > =. $utf82gbcodetable.#91; substr ($utf8,0,2).#93;
$utf8=substr ($utf8,2);
} else {
$gb.=substr ($utf8,0,1);
/ / UTF8 to GB2312 string encoding END
.Gt; [/code]