Home > Article > Backend Development > Introduction to php operating xml - attribute analysis of xml tags
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>
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:
(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!