This example describes the CDATA section of the Introduction to PHP operations XML. Share to everyone for your reference. The specific analysis is as follows:
Copy Code code as follows:
<?xml version= "1.0" encoding= "Utf-8" standalone= "yes"?>
<class>
<student id= "no<001" haha= "Beauty" >
<name> Little Joe </name>
<sex> Women </sex>
<age>23</age>
<info>
<! [cdata[
Content section &*&$#^@* (#)) $#*%#
]]></info>
</student>
<student>
<name> Zhou Yu </name>
<sex> male </sex>
<age>26</age>
</student>
</class>
Knowledge Points:
(1) The text in the XML document is parsed by the XML parser, but the content in the CDATA section is not parsed. Therefore, CDATA can contain special characters, such as &, <, and so on.
(2) CDATA section with <! [cdata[begins, ends with]]>.
The corresponding CDATA is the Pcdata:pcdata that represents the text to be parsed, and the constraint is defined in the DTD.
I hope this article will help you with your PHP operating XML program.