Solved PHP output XML prompted error on line 2 at column 162: EntityRef: expecting ‘;’

Solved PHP output XML prompted error on line 2 at column 162: EntityRef: expecting ‘;’

Solved PHP output XML prompted EntityRef: expecting ‘;’ show the lack of semicolon

XML error

  • Online solution 1
  • 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,

  • Online solution 2
  • 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
  •  

    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

    root

    Leave a Reply

    Your email address will not be published. Required fields are marked *

    This site uses Akismet to reduce spam. Learn how your comment data is processed.