XML : Need help parsing xml

  <ProductCatalog>    <product>      <AtrrList>        <element Name="Storage Capacity" Value="8 GB"/>        <element Name="Interface" Value="USB 2.0"/>      </AtrrList>    </product>    </ProductCatalog>    

This is xml that i need to parse, and i need Name and Value from element tag to put in array using loop.I have managed to read lines in php

  foreach ($xxml->AttrList->element as $rating) {      echo "<tr>";      echo "<td>";      $name = $rating['Name'];      echo $name;      echo "</td>";      echo "<td>";      $value = $rating['Value'];      echo $value;      echo "</td>";      echo "</tr>";  }    

but i just can't put that in array so i could save it into mysql database.

i would appreciate any help.

No comments:

Post a Comment