I'm doing a cURL of a twitter search atom feed. It's working except for when I try to get the user's image. (I'm pretty new with using objects)
This produces a parse error because of the @ sign:
$image = $xml->entry[$i]->link[1]->@attributes->href;
The $xml object structure looks like this:
[entry] => Array
(
[0] => SimpleXMLElement Object
(
[id] => tag:search.twitter.com,2005:2225612870
[published] => 2009-06-18T17:56:17Z
[link] => Array
(
[0] => SimpleXMLElement Object
(
[@attributes] => Array
(
[type] => text/html
[rel] => alternate
[href] => http://twitter.com/________/statuses/2225612870
)
)
[1] => SimpleXMLElement Object
(
[@attributes] => Array
(
[type] => image/png
[rel] => image
[href] => http://________.jpg
)
)
)
[title] => ________
[content] => ________
[updated] => 2009-06-18T17:56:17Z
[author] => SimpleXMLElement Object
(
[name] => ________
[uri] => http://twitter.com/________
)
)
How do I deal with the @ sign? or am I just completely wrong?