Menu
with the “simplexml_load_file” function i load an xml file into a variable called $staff. and when i use the print_r function on the $staff variable i get this result:
SimpleXMLElement Object
(
[FirstName] => Array
(
[0] => James
[1] => John
[2] => Wayne
[3] => Jack
[4] => Eric
[5] => Roger
)
)
when i look at the xml data it is styled as this:
<names>
</FirstName>
<FirstName>James</FirstName>
<FirstName>John</FirstName>
<FirstName>Wayne</FirstName>
<FirstName>Jack</FirstName>
<FirstName>Eric</FirstName>
<FirstName>Roger</FirstName>
</names>
can anyone tell me how i can output this using a foreach loop??