Simplexml - how to use it with ["@attributes"]=>

T

tinem

If have just started reading about simplexml and made some test using
var_dump($xml); and when it used with a "normal" xml it's ok like this
and I can test it further:

object(SimpleXMLElement)#1 (1) {
["book"]=>
array(3) {
[0]=>
object(SimpleXMLElement)#2 (3) {
["title"]=>
string(19) "Pride and Prejudice"
["author"]=>
string(11) "Jane Austen"
["description"]=>
string(32) "Jane Austen's most popular work."
}


but when I use it with a file I have made using phpmysql the code
looks like this:
object(SimpleXMLElement)#1 (1) {
["marker"]=>
array(6) {
[0]=>
object(SimpleXMLElement)#2 (1) {
["@attributes"]=>
array(9) {
["name"]=>
string(34) "Dame & Herre & Handicap - Bemandet"
["adresse"]=>
string(29) "Nyhavn ved (Stor Skibs Anker)"
["postnummer"]=>
string(4) "1051"
["by"]=>
string(1) "K"
["category"]=>
string(8) "handicap"
["wordpressUrl"]=>
string(67) "http://www.tinemuller.dk/new_wordpress/nyhavn-ved-
stor-skibs-anker/"
["lat"]=>
string(9) "55.680433"
["lng"]=>
string(9) "12.587767"
["id"]=>
string(1) "1"
}
}

I don't know how to handle ["@attributes"]=> - can anyone help,
please?

/Tine
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,065
Latest member
OrderGreenAcreCBD

Latest Threads

Top