I am trying to parse the contents of a WDDX packet and format it cleanly. I do not believe this to be much of a task BUT my feeble mind can't wrap around the fact that there are arrays WITHIN arrays. I have found a few articles on this topic, but none with this described.

Here is the packet:
<wddxPacket version="1.0">
<header/>
<data>
<struct>
<var name="Return_Code"><number>00</number></var>
<var name="Error_Code"><string></string></var>
<var name="Error_Message"><string></string></var>
<var name="mirahost Services">
<array length="4">
<struct>
<var name="Offer_Code"><string>DEV1</string></var>
<var name="Offer_Name"><string>mira</string></var>
<var name="List_Price"><string>$149.95</string></var>
</struct>
<struct>
<var name="Offer_Code"><string>DEV2</string></var>
<var name="Offer_Name"><string>royal</string></var>
<var name="List_Price"><string>$149.95</string></var>
</struct>
<struct>
<var name="Offer_Code"><string>DEV3</string></var>
<var name="Offer_Name"><string>regal</string></var>
<var name="List_Price"><string>$199.95</string></var>
</struct>
<struct>
<var name="Offer_Code"><string>DEV4</string></var>
<var name="Offer_Name"><string>elite</string></var>
<var name="List_Price"><string>$269.95</string></var>
</struct>
</array>
</var>
</struct>
</data>
</wddxPacket>

Can someone help me figure out how to break this all up and spit it out? I can handle the fromating,ect. I just can't get each element out. Thank you!

    Here is the solution:

    foreach($value["mirahost_Services"] as $array) {
    $offer_code = $array["Offer_Code"];
    echo $offer_code;
    $offer_name = $array["Offer_Name"];
    echo $offer_name;
    $list_price = $array["List_Price"];
    echo $list_price;
    }

      Write a Reply...