Here is a simple method for searching nested arrays.
<?php
function in_array_multi_key($needle, $haystack)
{
// mutidimentional search for in_array function
// only matches the key, values don't count.
if ( array_key_exists($needle, $haystack) )
{
return TRUE;
}
foreach ( $haystack as $key => $value )
{
if ( is_array($value) )
{
$work = in_array_multi_key($needle, $value);
if ( $work )
{
return TRUE;
}
}
}
return FALSE;
}
?>
(Code from www.nitrotech.org)