Code: Select all
$parsed_xml = simplexml_load_string($Response);
$Items = (array)$parsed_xml->Items;
$Item = (array)$Items['Item']; // up to 10 max
if ($Item[0])
foreach ($Item as $i=>$Item_Data)
print_product($i, $Item_Data);
else print_product(-1, $Item);
Code: Select all
$EAN = $Item_Data->ItemAttributes->EAN;Code: Select all
$EAN = $Item[ItemAttributes]->EANIs there a way to fix this so the same code can be used with single or multiple element arrays?