Home >Backend Development >PHP Tutorial >Basic introduction to xml and xml tag elements, xml tags_PHP tutorial for getting started with php operation xml

Basic introduction to xml and xml tag elements, xml tags_PHP tutorial for getting started with php operation xml

WBOY
WBOYOriginal
2016-07-13 10:09:22962browse

Basic introduction to xml and xml tag elements for getting started with php operation xml, xml tags

The examples in this article describe the basic introduction of XML and XML tag elements for getting started with PHP operation of XML. Share it with everyone for your reference. The specific analysis is as follows:

Explain using xml examples:

Copy code The code is as follows:



Xiao Qiao
Female
23


Zhou Yu
Male
27


1. xml declaration:


(1). The xml statement should be placed on the first line of the document;
(2), encoding: document character encoding, such as utf-8, gb2312, etc.
(3), standalone: ​​The value is yes or no, optional, indicating whether the document definition is independent, that is, whether it is related to other documents. The default is no.

2. Root element

The outermost is the root element. Each xml document must have and can only have one root element.

3. xml element/tag/node

, , , , etc. are all xml elements. Also called labels or nodes. Of course, the root element is also an element.
If there is no content in the tag, for example, there is no entity content between , it can be abbreviated as . Even if it is written as , when the browser is opened, it will still display

4. Spaces and line breaks in tags

For spaces and line breaks that appear in the

tag, the xml document will treat the spaces and line breaks as original content. So, pay special attention when programming.

5. Naming convention of xml tags

(1) Case sensitive;
(2) Cannot start with a number or "_";
(3) It cannot start with special characters such as xml, XML, or Xml;
(4) Cannot contain spaces;
(5) Cannot contain colon.

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

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/946741.htmlTechArticle Basic introduction to xml and xml tag elements, xml tags for getting started with php operation Basic introduction to xml and xml tag elements. Share it with everyone for your reference. Specifically...
Statement:
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