Solved PHP output XML prompted error on line 2 at column 162: EntityRef: expecting ‘;’
- By : YaoYuan
- Category : linux Tutorial
- Tags : error, php, XML
- Comment : 0
Solved PHP output XML prompted EntityRef: expecting ‘;’ show the lack of semicolon
Baidu, the discovery of XML is a special character (&, <,>, “,”) caused by the vast majority of the solution:
Replace special characters with entity value strings (& amp;).
He meow, but how do I replace double quotes and single quotation marks, this answer did not tell,
Another solution is to wrap up with <! [CDATA ]>.
Pit a meow, and it is simple to say, but I just want to show in that line, the other lines gave me such a result
The solution found at last
You can use this function to special characters to the entity value string, the PHP5.6 test environment, normal use