Hello Reader we almost have header about array_key_exits and isset but you need to know the diffrence between them.
Lets take an example below:-
array_key_exists will only work when your key have an element and doesnt matter it is null, but isset will only return true if the key/variable exists and is not null.
$myArray = array('key1' => 'first', 'key2' => null);
isset($a['key1']); // return **true**
array_key_exists('key1', $myArray ); // return **true**
isset($a['key2']); // here return is **false**, because key is null
array_key_exists('key2', $myArray ); // return **true**
0 Comment(s)