Answers for "php array key exists vs isset"

PHP
1

array_key_exists vs isset

$a = array('key1' => 'text', 'key2' => null);

isset($a['key1']);             // true
array_key_exists('key1', $a);  // true

isset($a['key2']);             // false
array_key_exists('key2', $a);  // true
Posted by: Guest on March-22-2021

Browse Popular Code Answers by Language