From my own experience, if you got, for example:
Array ( [1] => Array ( [0] => a [1] => b ) [2] => Array ( [0] => b ) [4] => Array ( [0] => c ) )
In array_search("a", $array[3]) !== FALSE) it returns TRUE the same, therefore, to cover all cases, also in the null element, it is better to use:
if ( (array_search($element, $array) !== FALSE) && ($array) ) { echo "found"; }
Hope this helps.
vicrec
source share