Isset vs array_key_exists
isset
- It is language construct, not a function
- It is used to find whether variables are set or not.
array_key_exists
This function is used to check whether key exists in an array
Example:
$arr = array(1=>0,2=>”two”);
print_r($arr);
echo isset($arr[1]);
echo array_key_exists(1,$arr);
In the above example isset and array_key_exists,both will return 1. But isset is a language construct, so it should be faster that array_key_exists
