Trouble figuring out a Walk through an Array
| From: | Phillip S. Baker | Date: | Thu, 13 Oct 2005 16:11:59 +0000 |
| Subject: | Trouble figuring out a Walk through an Array | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-224064@lists.php.net to get a copy of this message | ||
Greetings All,
Having trouble figureing out a certain walk through an array.
And I am not finding the help I need in the manual or anything.
I have an associative arr ($arr) With about 20 elements in it.
Ten of which are required. So I have another associative array called
$required, with all the elements in the array that are required.
I have initaited a foreach loop on the $arr splitting things into $key and
$value.
Now the part I am having trouble with is this.
I want to see if $key matches any of the values in $required. If so do
something in particular. If not then do something else. It does not
particularly matter which value in the $required it matches, just so long as
it matches.
Thanks for any help.
Phillip