Nathan Riley
asked on
Grabbing PHP variable
Having trouble grabbing the URL field from this string in php:
Tried
$e->@attributes->url
$e['@attributes']['url']
Neither are working for me
object(SimpleXMLElement)#11 (1) { ["@attributes"]=> array(2) { ["url"]=> string(46) "http://pbs.twimg.com/media/Cr2xto1UkAA56xV.jpg" ["type"]=> string(10) "image/jpeg" } }
Tried
$e->@attributes->url
$e['@attributes']['url']
Neither are working for me
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
See line 75 in the prior code snippet. It might be necessary to cast the variable as a string, depending on what you want to do with the URL.
@N R:
I encourage you to read more about using SimpleXMLElement class:
http://php.net/manual/en/class.simplexmlelement.php
I encourage you to read more about using SimpleXMLElement class:
http://php.net/manual/en/class.simplexmlelement.php
Open in new window