array_key_exists
will tell you if a key exists in an array and complains when$a
does not exist.isset
will only returntrue
if the key/variable exists and is notnull
.isset
doesn’t complain when$a
does not exist.
Consider:
$a = array('key1' => 'Foo Bar', 'key2' => null);
isset($a['key1']); // true
array_key_exists('key1', $a); // true
isset($a['key2']); // false
array_key_exists('key2', $a); // true