1
2<?php
3
4$a = array ('test' => 1, 'hello' => NULL, 'pie' => array('a' => 'apple'));
5
6var_dump(isset($a['test'])); // TRUE
7var_dump(isset($a['foo'])); // FALSE
8var_dump(isset($a['hello'])); // FALSE
9
10// The key 'hello' equals NULL so is considered unset
11// If you want to check for NULL key values then try:
12var_dump(array_key_exists('hello', $a)); // TRUE
13
14// Checking deeper array values
15var_dump(isset($a['pie']['a'])); // TRUE
16var_dump(isset($a['pie']['b'])); // FALSE
17var_dump(isset($a['cake']['a']['b'])); // FALSE
18
19?>
20
21