Quote:
Originally Posted by Arcticwarrio
you could try 2 loops?
im not sure if [0] => Dummy page will be found as [1] => Dummy%20page
PHP Code:
foreach($menuxml as $k1 => $v1) { foreach($menufile as $k2 => $v2 { if ($v1 = $v2) { unset($menuxml[$k1]); } } }
|
Well, it kinda worked. I changed the XML content in Dummy%20page, etc...
Put the ')' behind the first $v2, and it did run, but got out empty again.
I think this is happening:
Once 'Array( [0] => Dummy%20page%202' is coming in, is checks with the first child of $menuxml: Array( [0] =>
SimpleXMLElement Object( [0] => Start ), instead of the child of SimpleXMLElement Object.
So how do I get the child-child? Or am I wrong there?
Edit:
I rebuilded my $menuxml so it has the data as a direct child, and it still gets erased...
This is $menuxml at first:
Code:
Array
(
[0] => Start
[1] => Dummy%20page
[2] => Dummy%20page%202
)
And after this:
PHP Code:
foreach($menuxml as $k1 => $v1) {
foreach($menufile as $k2 => $v2) {
if ($v1 = $v2) {
unset($menuxml[$k1]);
}
}
}
It turns into this:
What is going wrong?
Is it the id ([0], [1], etc...) that mismatches?