After php parses the dom, Chinese characters are programmed to be similar to ascii. php & nbsp; after dom parsing, & nbsp; Chinese characters are programmed to be similar to ascii, but Chinese characters are normally displayed on the webpage, after viewing the source code, you can view the source code in ascii format. & lt; div & nbsp; contentScore8405 & gt; & nbsp; after php parses the dom, Chinese characters are programmed to something similar to ascii.
After php parses the dom, Chinese characters are programmed to something similar to ascii, but Chinese characters are normally displayed on the webpage, and the source code is converted into ascii.
View the source code
In the past two months, WeChat marketing has been spreading like crazy. I have been paying attention to this new thing. Gradually, I have some opinions. I 'd like to share it with you today.
I first paid attention to "Wang Lihong". I told him a sentence, and he quickly returned a long speech. then I did not talk about it. From the very beginning, I knew that this must have been done by machines. out of curiosity, I talked to him from time to time and did not reply much. It was also the kind of things that I could say to anyone. One day, he suddenly received a WeChat message from Wang Li Hong, which said about his concert in Jiaxing. I think this is also recorded in the WeChat platform.
Idea: put the data into the $ ContentBox variable after processing the data. if $ ContentBox-> nodeValue is directly output, the webpage and source code are displayed normally, but the html tag (such as p src) and the image is gone. if you copy $ ContentBox to another dom, the webpage is displayed normally, but the source code text is similar to ascii (the labels and images are not lost ), as follows,
$Target = new DOMDocument;
$Target->appendChild($Target->importNode($ContentBox, true));
echo $Target->saveHTML();
What is the reason? how can this problem be solved?
------ Solution --------------------
$ Target = new DOMDocument ('1. 0 ', 'utf-8'); $ ContentBox = $ Target-> importNode ($ ContentBox, true); echo $ Target-> saveXML ($ ContentBox );