Home > Backend Development > XML/RSS Tutorial > Introduction to cdata section of php operation xml

Introduction to cdata section of php operation xml

高洛峰
Release: 2016-12-24 11:39:44
Original
2071 people have browsed it

The example in this article describes the cdata section of getting started with php operating xml. Share it with everyone for your reference. The specific analysis is as follows:

<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<class>
 <student id="No<001" haha="美女">
  <name>小乔</name>
  <sex>女</sex>
  <age>23</age>
  <info>
  <![CDATA[
  内容部分&*&$#^@*(#))$#*%#
  ]]></info>
 </student>
 <student>
  <name>周瑜</name>
  <sex>男</sex>
  <age>26</age>
 </student>
</class>
Copy after login

Knowledge points:

(1) The text in the xml document will be parsed by the xml parser, but the content in the cdata section will not be parsed. Therefore, cdata can contain some special characters, such as &, <, etc.
(2) The cdata section starts with .

Corresponding to CDATA is PCDATA: PCDATA represents the text to be parsed, and constraints are defined in DTD.

I hope what is described in this article will be helpful to everyone’s php operation XML programming.


For more related articles on the cdata section of getting started with php operation xml, please pay attention to the PHP Chinese website!


Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template