Jump to content

cURL @ Sign Parse Error


mattN83

Recommended Posts

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?

Link to comment
https://forums.phpfreaks.com/topic/162849-curl-sign-parse-error/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.