UPDATE: I\'ve reworked the question, to show progress I\'ve made, and maybe make it easier to answer.
UPDATE 2: I\'ve added another value to the XML. Extension avail
This is the code that will give you the result you need. UPDATE: This concerns the latest grouping you asked for.
$scrape_xml = "files.xml";
$xml = simplexml_load_file($scrape_xml);
$groups = array();
foreach ($xml->Item as $file){
$platform = stripslashes($file->Platform);
$name = stripslashes($file->Name);
$title = stripslashes($file->Title);
$extensions = explode(' ', $file->Ext);
foreach($extensions as $extension)
{
if (!isset($groups2[$platform])) $groups2[$platform] = array();
if (!isset($groups2[$platform][$extension])) $groups2[$platform][$extension] = array();
$groupFound = false;
for($idx = 0; $idx < count($groups2[$platform][$extension]); $idx ++) {
if ($groups2[$platform][$extension][$idx]["Name"] == $name
&& $groups2[$platform][$extension][$idx]["Title"] == $title) {
$groups2[$platform][$extension][$idx]["Files"][] =
array('DownloadPath' => $file->DownloadPath."");
$groupFound = true;
break;
}
}
if ($groupFound) continue;
$groups2[$platform][$extension][] =
array(
"Name" => $name,
"Title" => $title,
"Files" => array(array('DownloadPath' => $file->DownloadPath."")));
}
}
echo "
";
echo "";
print_r($groups2);
echo "
";