While parsing xml I get the array below... what is the syntax for accessing the [id].
I have tried the following...
- $test = $search[0]['@attributes']['id']... ' i get null'
- $test = $search[0][@attributes]['id']... ' Use of undefined constant attributes - assumed 'attributes' '
- $test = $search[0]['id']... ' i get an array with the id value... however I want to avoid this.'
$search = array(
[0] => SimpleXMLElement Object
(
[@attributes] => Array
(
[id] => bk101
)
[author] => Gambardella, Matthew
[title] => XML Developer's Guide
[genre] => Computer
[price] => 44.95
[publish_date] => 2000-10-01
[description] => An in-depth look at creating applications with XML.
)
Thanks... in advance