$key = 'jim';
// example 1
if (isset($array[$key])) {
// ...
}
// example 2
if (array_key_exists($key, $array)) {
// ...
}
Out of these two examples which one is a better option? I usually use the first one but I have seen people using the second one more. So can someone please tell me which one is a better option?