Я пытаюсь разобрать этот XML-фид
[0] => SimpleXMLElement Object
(
[title] => Johannesburg in November
[link] => SimpleXMLElement Object
(
[@attributes] => Array
(
[rel] => alternate
[type] => text/html
[href] => http://www.tompeters.com/dispatches/012120.php?rss=1
)
)
[id] => tag:www.tompeters.com,2011://2.12120
[published] => 2011-09-08T14:03:23Z
[updated] => 2011-09-08T14:11:49Z
[summary] => Tom will be giving a day-long presentation in November in Johannesburg, South Africa. Our friends at the Business Results Group...
[author] => SimpleXMLElement Object
(
[name] => Shelley Dolley
)
[category] => SimpleXMLElement Object
(
[@attributes] => Array
(
[term] => Announcements
[scheme] => http://www.sixapart.com/ns/types#category
)
)
[content] => SimpleXMLElement Object
(
[@attributes] => Array
(
[type] => html
)
)
)
мой PHP-код для этого -
$url = 'http://www.tompeters.com/atom.xml';
$xml = simplexml_load_file($url);
echo '<pre>';
foreach($xml->entry as $entry){
echo $entry->title;
echo "<br />";
foreach ($entry->link->@attributes as $attr){
echo $attr->href;
echo "<br />";
}
}
проблема в том, что бит @attributes
нарушает код ..
Как мне получить эту ссылку href?