Hi guys,

I have an array with navigation items like that:

$navigationItemArr = array("Home"=>"home",
                 "Profile"=>"profile",
                 "Photogallery"=>"photogallery",
                 "Contact"=>array("contact","subsection")
                 );

How can I check for a value in this array?
I tried something like this:


.
.
..for.... $i++.. { // there is a normal for cycle, this is just an illustration
.
.

       if(in_array($bodyVariablePiece[$i], $navigationItemArr)) {
           echo "$bodyVariablePiece[$i] [$i] - ok<br />";
       }
       else {
           echo "$bodyVariablePiece[$i] [$i] - error<br />";
       }
.
.
}
.
.


* in $bodyVariablePiece are values extracted from URL like - home, profile, photogallery, contact Everything works except contact - there it show error. So what is the correct way to check values in multidimensional arrays? Is it possible with in_array() function?

Thanks,
Erik

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to