Introduction to php operating xml - attribute analysis of xml tags

高洛峰
Release: 2016-12-24 11:11:48
Original
1354 people have browsed it

The example in this article describes the attributes of xml tags for 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="No001" haha="美女">
  <name>小乔</name>
  <sex>女</sex>
  <age>23</age>
 </student>
 <student>
  <name>周瑜</name>
  <sex>男</sex>
  <age>26</age>
 </student>
</class>
Copy after login

How to write attributes, such as id="No001" in the case.

Note:

(1) Attribute values ​​must be separated by single quotes or double quotes;
(2) An xml tag can have multiple attributes;
(3) Attribute values ​​cannot contain and & symbol; if present, a predefined entity reference in xml is used. There are 5:

Introduction to php operating xml - attribute analysis of xml tags

(4) The same attribute name cannot appear in the same tag: if there is already id="No001", there cannot be another id="No002".
(5) Comment method:

I hope this article will be helpful to everyone’s PHP operation XML programming.

For more articles related to the attribute analysis of xml tags for 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
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!