Essentially I have 2 arrays, both returned from mysql via a function which executes the query(s) and returns an array.
$array_1 structure looks something like this:
Code: Select all
array
(
ї0]=>Array
(
ї0]=> some_item
)
ї1]=> Array
(
ї0]=> some_item
)
on through 100I was attempting to use a foreach to iterate over the shorter array and use in_array to check for a value, however, the difference in array lengths got me stuck. The bottom line is how would one use in_array on multidimensional array?
Code: Select all
My attempts were along these lines
foreach( $array_2 as $temp )
{
if( in_array( $tempї0], $array_1 ))// or array_1ї0] ??
{
do something...
}
}For my purposes I ended-up flattening both arrays to one dimension, but I'd to know how to make my original array do the job