I have the following xml parsed with simplexml_load_string:
<ItemAttributes>
<Binding>Misc.</Binding>
<Brand>Gotcha</Brand>
<Feature>schöne Kontraststickerei</Feature>
<Feature>langer und taillierter Schnitt</Feature>
<Feature>kleine Kängurutasche</Feature>
<Feature>Druckknopfleiste mit großen Metallknöpfen</Feature>
<Feature>Rückseite figurbetonend gerafft</Feature>
<ProductGroup>Sports</ProductGroup>
<ProductTypeName>SPORTING_GOODS</ProductTypeName>
<Title>Gotcha Damen Strickjacke</Title>
</ItemAttributes>
And want to fetch all "Feature" within on Array key. actually i'm doing like this:
$response = array(
"details" => htmlentities((string) $item->ItemAttributes->Feature)
);
With that i only fetch the first attribute. The "schöne Kontraststickerei". but i want to have all attributes in the $response['details']. in best case comma separated.
$response = array(); foreach ($item->children() as $node) { $response[] = $node->Feature; } print_r($response);