0

I have this content in a variable in PHP. How do I make a foreach where I have the field name in one variable and the value in another?

<Transaction id="1">
<Table name="if_802_11_stats">
<Body status="0" statusdescription="" startrecord="1" endrecord="242"     totalrecords="242">
<Entry status="0">
<Field name="IfIndex">1</Field>
<Field name="NodeType">ap</Field>
</Entry>
<Entry status="0">
<Field name="IfIndex">2</Field>
<Field name="NodeType">ap</Field>
</Entry>
</Body>
</Table>
</Transaction>
S.F
  • 1
  • 1
    http://php.net/manual/en/function.xml-parse-into-struct.php – Ôrel Mar 02 '15 at 08:08
  • How do I then foreach when i have the two variables? – S.F Mar 02 '15 at 08:16
  • possible duplicate of [How do you parse and process HTML/XML in PHP?](http://stackoverflow.com/questions/3577641/how-do-you-parse-and-process-html-xml-in-php) – ThW Mar 02 '15 at 09:08
  • see this: http://stackoverflow.com/questions/19561657/loop-through-an-xml-object-with-simplexml – michi Mar 02 '15 at 17:43

0 Answers0