我有以下要解析的xml。
Array
(
[0] => SimpleXMLElement Object
(
[@attributes] => Array
(
[rel] => http://schemas.google.com/g/2005#other
[address] => xyz@gmail.com
[primary] => true
)
)
[1] => SimpleXMLElement Object
(
[@attributes] => Array
(
[rel] => http://schemas.google.com/g/2005#other
[address] => abc@gmail.com
[primary] => true
)
)
)
我有这个上面的 xml,我只需要从这个 xml 中获取地址。
foreach ($result as $title) {
$email[$count++]=$title->attributes()->address->__toString;
}
debug($email);
结果是这样的。但我只想要地址。需要一些帮助。
Array
(
[0] => SimpleXMLElement Object
(
)
[1] => SimpleXMLElement Object
(
)
)