How to loop through xm document which have attribute with symbol in name

qld3000

New Member
I'm looping through a xml file, but I want to use an attribute name which has the "-" in it.\[code\] foreach( $xml as $person) { echo 'Name: '.$person->Name.'<br />'; echo 'Home address: '.$person->home-address.'<br />'; echo 'Away address: '.$person->away-address.'<br />'; } \[/code\]The "-" symbol breaks the script, how do I make this work? I don't want to rename the attribute.
 
Back
Top