When PHP reads an XML file, it intercepts the following part: & nbsp; & lt ;? Php $ domnewDOMDocument; $ dom-& gt; load (& quot; Practice. xml & quot;); this line has an error & nbsp ;..... & nbsp ;..... & nbsp ;? & Gt; error message: & nbsp; an error occurred while reading the XML file in PHP.
CLIP:
$ Dom = new DOMDocument;
$ Dom-> load ("Practice. xml"); // This row has an error.
.....
.....
?>
Error message:
Warning: DOMDocument: load () [domdocument. load]: Input is not proper UTF-8,
Indicate encoding! Bytes :......
In the Practice. xml document, I used encoding = "UTF-8", but I still cannot see Chinese content. I don't know where the problem is?
------ Solution --------------------
Practice. xml also uses UTF-8 encoding
------ Solution --------------------
Practice. xml must be UTF-8 encoded during storage.
------ Solution --------------------
You do not need to save the php file as UTF-8
Instead, you need to save the xml file as UTF-8
Since the xml file has been declared
If the content is not UTF-8, an error is returned.
You can also modify the xml language declaration.