Finally Emperor not bear, the answer or let me find.
It's all on the Internet.
Copy CodeThe code is as follows:
$content = Iconv ("Utf-8", "gb2312", $content);
In fact, it is also right, looking at the Utf-8 is actually converted into gb2312, but the actual operation of the words, often fail to end, why?
The reason is actually very simple, because any function is the time to execute the error, and unfortunately Iconv (), it is finally error. Now give you the right answer.
The real answer is this.
Copy CodeThe code is as follows:
$content = Iconv ("Utf-8", "Gb2312//ignore", $content);
It's simple, just add a//ignore to the back, plus this can be the iconv () function ignores the error and continues execution.
Similarly, want to change gb2312 as utf-8 as long as write $content = Iconv ("gb2312", "Utf-8//ignore", $content);
http://www.bkjia.com/PHPjc/321499.html www.bkjia.com true http://www.bkjia.com/PHPjc/321499.html techarticle finally Emperor not bear, the answer or let me find. It's all over the Web. The copy Code code is as follows: $content = Iconv ("Utf-8", "gb2312", $content); In fact, this is also true ...