![]() |
Comparing multi-array keys with other multi-array keys.
So I got this piece of script puzzled out:
PHP Code:
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:
ArrayCode:
ArrayCorrect me in anyway you see fit :) |
you could try 2 loops?
im not sure if [0] => Dummy page will be found as [1] => Dummy%20page PHP Code:
|
Quote:
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:
ArrayPHP Code:
Code:
ArrayIs it the id ([0], [1], etc...) that mismatches? |
maybe something like:
PHP Code:
|
PHP Code:
so this should work: PHP Code:
|
I will try that one, and i have an idea... maybe it will work.
Edit: Both don't seem to work... I putted my code here: --link deleted by poster-- You can see the nice build up if you see the source code of the page. |
sorry i had an equals mising :S
PHP Code:
array(3) { [0]=> array(1) { ["SimpleXMLElement Object"]=> array(1) { [0]=> string(5) "Start" } } [1]=> array(1) { ["SimpleXMLElement Object"]=> array(0) { } } [2]=> array(1) { ["SimpleXMLElement Object"]=> array(1) { [0]=> string(11) "lorem ipsum" } } } |
Well, it seems it keeps clearing the entire array in my full script, so I begin to think something in my full script is causing it...
I luckily have a teacher at my school who can browse trough my whole code, so I will try that. Arcticwarrio; thank you for your help, now I understand some more about it and might be of support later on.:thumbsup: |
YOU STILL HAVE 1 = IN THE MENU.TXT LINK YOU POSTED:
PHP Code:
if ($v1 = $v2) { should be if ($v1 == $v2) { |
Quote:
It works now :) |
sorry wrong quote also...
this is the one that works lol PHP Code:
|
| All times are GMT +1. The time now is 07:27 PM. |
Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.