Home  >  Article  >  Backend Development  >  php操作xml入门之xml标签的属性分析_php技巧

php操作xml入门之xml标签的属性分析_php技巧

WBOY
WBOYOriginal
2016-05-16 20:25:011086browse

本文实例讲述了php操作xml入门之xml标签的属性。分享给大家供大家参考。具体分析如下:

复制代码 代码如下:


 
  小乔
 
  23
 

 
  周瑜
 
  26
 


属性的写法,如案例中的 id="No001"。

注意点:

(1)属性值必须用单引号、或双引号分隔;
(2)一个 xml 标签可以有多个属性;
(3)属性值不能包含和&符号;如果有要出现,则使用 xml 中的预定义实体引用。有5个:

(4)不能在同一个标签中,出现相同的属性名:如已有 id="No001",则不能再有id="No002"。
(5)注释方法:

希望本文所述对大家的php操作XML程序设计有所帮助。

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