So I got this piece of script puzzled out:
PHP Code:
foreach($menuxml as $key => $menuitem) {
if( !in_array($menuitem, $menufile)) {
unset($menuxml[$key]);
}
}
Where $menuxml is filled from a piece of script reading a xml file and $menufile from a script reading files.
Now I have that if one $menuitem mismatches, the entire $menuxml is empty.
And I figured out that every $menuitem has to be compared with every entry in $menufile. But how do I get that done? I got $menufile in there instead of it's entries.
Content of $menuxml and $menufile:
$menuxml:
Code:
Array
(
[0] => SimpleXMLElement Object
(
[0] => Start
)
[1] => SimpleXMLElement Object
(
[0] => Dummy page
)
[2] => SimpleXMLElement Object
(
[0] => lorem ipsum
)
$menufile:
Code:
Array
(
[0] => Dummy%20page%202
[1] => Dummy%20page
)
My goal: if $menuxml entry is not in a $menufile entry, unset that $menuxml entry.
Correct me in anyway you see fit