skaterdav85 Posted April 30, 2012 Share Posted April 30, 2012 I did a print_r on a simplexml object and I get the following: SimpleXMLElement Object( [@attributes] => Array ( [term] => Standards [scheme] => Responsible Organization ) ) How do I access @attributes? I want to get the array element [scheme]. $root->@attributes throws a syntax error because of the @ symbol. Link to comment Share on other sites More sharing options...
boen_robot Posted May 1, 2012 Share Posted May 1, 2012 You get them by calling the attributes() method over the element you're on.So, print_r($root->attributes()); Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now