Just a very simple function iconv (); But this is the function of the Internet to find a lot of examples, can not be converted successfully, this is why? finally Emperor not bear, the answer or let me find.
It's all on the Internet.
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.
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);
PHP iconv solve Utf-8 and gb2312 encoding conversion issues