原来数据源格式如下:<?xml version="1.0" encoding="utf-8" ?>
<string xmlns="http://tempuri.org/">山东省济南市网通</string>处理函数如下:
function getTree() {
$i = 0;
$tree = array(); $tree = $this->addNode(
$tree,
$this->_struct[$i]['tag'],
(isset($this->_struct[$i]['value'])) ? $this->_struct[$i]['value'] : '',
(isset($this->_struct[$i]['attributes'])) ? $this->_struct[$i]['attributes'] : '',
$this->getChild($i)
); unset($this->_struct);
return ($tree);
}
现在的数据源格式发生变化了,如下 <?xml version="1.0" encoding="utf-8" ?>
- <ArrayOfString xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://webservice.jaron.cn/">
<string>山东省济南市</string>
<string>网通</string>
<string>山东省济南市网通</string>
</ArrayOfString>现在我要 获得 新数据源 第三个节点:山东省济南市网通 这个数据 新的函数应该怎么写啊 谢谢 我的分数已经没有了
<string xmlns="http://tempuri.org/">山东省济南市网通</string>处理函数如下:
function getTree() {
$i = 0;
$tree = array(); $tree = $this->addNode(
$tree,
$this->_struct[$i]['tag'],
(isset($this->_struct[$i]['value'])) ? $this->_struct[$i]['value'] : '',
(isset($this->_struct[$i]['attributes'])) ? $this->_struct[$i]['attributes'] : '',
$this->getChild($i)
); unset($this->_struct);
return ($tree);
}
现在的数据源格式发生变化了,如下 <?xml version="1.0" encoding="utf-8" ?>
- <ArrayOfString xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://webservice.jaron.cn/">
<string>山东省济南市</string>
<string>网通</string>
<string>山东省济南市网通</string>
</ArrayOfString>现在我要 获得 新数据源 第三个节点:山东省济南市网通 这个数据 新的函数应该怎么写啊 谢谢 我的分数已经没有了
得到string的个数 用循环可以取吧