Late to the party, but wanted to add some context / examples:
array_search will return the key (if the value is found) - which could be 0 - and will return FALSE if the value is not found. It never returns TRUE.
This code may sum it up better:
// test array...
$array = [
0 => 'First Item',
1 => 'Second Item',
'x' => 'Associative Item'
];
// example results:
$key = array_search( 'First Item', $array ); // returns 0
$key = array_search( 'Second Item', $array ); // returns 1
$key = array_search( 'Associative Item', $array ); // returns 'x'
$key = array_search( 'Third Item', $array ); // returns FALSE
Since 0 is a falsey value, you wouldn't want to do something like if ( ! array_search(...) ) {... because it would fail on 0 index items.
Therefore, the way to use it is something like:
$key = array_search( 'Third Item', $array ); // returns FALSE
if ( FALSE !== $key ) {
// item was found, key is in $index, do something here...
}
It's worth mentioning this is also true of functions like strpos and stripos, so it's a good pattern to get in the habit of following.