If you wanted to compare the given value against every value in the array you could just use a loop
for ( $loop=0; $loop<count($array_vals); $loop++ )
{
if ( stristr($array_vals[$loop], $match_val) )
{
echo "Found match at position ".$loop."<BR>\n";
}
}
I never was a fan of foreach. But each to there own.
If you just want to find the location of the value in the array and it is a big array you could use a binary chop method to locate the entry.
Mark.