Hi All,
I've been using the following to parse XML code from amazon:
foreach ($values as $key=>$val) {
switch ($val['tag']) {
case 'ErrorMsg':
$ErrorMsg = $val['value'];
break;
case 'Asin':
$ISBN = $val['value'];
break;
case 'ProductName':
$ProductName = $val['value'];
break;
case 'ReleaseDate':
$ReleaseDate = $val['value'];
break;
case 'ImageUrlSmall':
$ImageUrlSmall = $val['value'];
break;
}
}
This works great dealing with Amazon, but now I'm trying to parse a different XML source and even though I changed the cases and the values, it doesn't seem to work. I think the problem is with $val['value']. Any idea how to change this to make it work?