PHP用DOMDocument()获取XML文档的标签值(最基础的方法)

PHP代码:

<?php
$doc=new DOMDocument();//实例化DOM对象
$doc->load(“text.xml”);//载入XML文件

$name=$doc->g[……]