Add the following $ xml = "<? Xml version = '1. 0' encoding = 'utf-8'?>
<Address>
<Street> Lot 11, Happy Street </street>
<State> Florida </state>
<Country> USA </country>
</Address>
"; Post to the server, the server parses through simplexml_load_string, and reports
Code Warning: simplexml_load_string () [function. simplexml-load-string]: Entity: line 1: parser error: String not started expecting 'or "in C: \ Cycler \ process. php on line 14
Warning: simplexml_load_string () [function. simplexml-load-string]: <? Xml version = \ "1.0 \" encoding = \ "UTF-8 \"?> In C: \ AppSer \ process. php on line 14
Warning: simplexml_load_string () [function. simplexml-load-string]: ^ in C: \ javaser \. php on line 14
Warning: simplexml_load_string () [function. simplexml-load-string]: Entity: line 1: parser error: Malformed declaration expecting version in C: \ AppSer \. php on line 14
Warning: simplexml_load_string () [function. simplexml-load-string]: <? Xml version = \ "1.0 \" encoding = \ "UTF-8 \"?> In C: \ AppSer \ process. php on line 14
Warning: simplexml_load_string () [function. simplexml-load-string]: ^ in C: \ javaser \ process. php on line 14
Warning: simplexml_load_string () [function. simplexml-load-string]: Entity: line 1: parser error: Blank needed here in C: \ javaser \ process. php on line 14
Warning: simplexml_load_string () [function. simplexml-load-string]: <? Xml version = \ "1.0 \" encoding = \ "UTF-8 \"?> In C: \ AppSer \ process. php on line 14
Warning: simplexml_load_string () [function. simplexml-load-string]: ^ in C: \ javaser \ process. php on line 14
Warning: simplexml_load_string () [function. simplexml-load-string]: Entity: line 1: parser error: parsing XML declaration: '?> 'Expected in C: \ javaser \ process. php on line 14
Warning: simplexml_load_string () [function. simplexml-load-string]: <? Xml version = \ "1.0 \" encoding = \ "UTF-8 \"?> In C: \ AppSer \ process. php on line 14
Warning: simplexml_load_string () [function. simplexml-load-string]: ^ in C: \ javaser \ process. php on line 14
Error.
Through the initial troubleshooting, I think it is because the characters are formatted in html, that is
Htmlspecialchars-Convert special characters to HTML entities.
So I tried
Htmlspecialchars_decode-Convert special HTML entities back to characters
Format it back. But the error persists.
Google found that other comrades had encountered such a problem and analyzed the reason for the quotation marks.
Pass
Stripslashes-Un-quotes a quoted string
After processing the post content. Solve the problem.