in_array() v/s array_key_exists()
Difference:
in_array() checks if a value exists in an array (checks the values, not the keys) and returns true, or false otherwise.
while:
array_key_exists() checks if the given key or index exists in the array (checks in keys, not in values) and returns true, or false otherwise.
Visits the manual (links above) for examples and more information.
<?php
$search_array = array('first' => null, 'second' => 4);
// returns false
isset($search_array['first']);
// returns true
array_key_exists('first', $search_array);
?>
array_key_exists($key_to_search, $array)