How does PHP filter special characters? or replace 16 binary:
In the process of calculating a DOM, because there is a man in the body who does not know what the Chinese character
As a result, the following code appears with the following error
Code:
PHP Code
$DQ = new Zend_dom_query ($body); $DQ->query ("*");
The original body is gb2312 encoded, and the error that occurs is:
[0]=>
Object (Libxmlerror) #45 (6) {
["Level"]=>
Int (3)
["Code"]=>
Int (6003)
["Column"]=>
Int (0)
["Message"]=>
String (*) "input conversion failed due to input error, bytes 0xCB 0x87 0xCA 0xFB
"
["File"]=>
String (0) ""
["Line"]=>
Int (0)
}
Error in 0xCB 0x87 0xCA 0xFB is (art villa) Two words, I do not know if this post submitted after the Chinese character can be displayed correctly, Baidu Search is not ...
Is there a way to replace these two characters?
I str_replace, I didn't succeed.
Preg_replace doesn't seem to be good either.
PS can be seen in the ultraedit .....
is how to replace the 16 binary???
------Solution--------------------
Body changed to GBK?
------Solution--------------------
Turn into coded form
$str = ' People's Republic of China ';
$str = mb_convert_encoding ($str, "html-entities", "utf-8");//Result: Which team is the first to tee off