I am parsing xml using simplexml_load_string like this :
$xml = simplexml_load_string($response);
echo '{'.
'"Date":"'.$xml->Date[0].'",'.
'"Description":"'.$xml->ShipTos->ShipTo->ShippingGroups->ShippingGroup->OrderItems->OrderItem->Description[0].'",'.
'"Track":"'.$xml->Shipments->Shipment->Track[0].'"'.
'}';
This works ok but if a node appears in the xml multiple times it only grabs it once. Can someone please help me understand how I would write a foreach loop specifically for the Description node?