http://us1.php.net/manual/zh/function.isset.php
1, ' hello ' = NULL, ' pie ' = = Array (' a ' = ' = ' apple '); Var_dump (isset ($a [' Test '] ); Truevar_dump (isset ($a [' foo ']); Falsevar_dump (isset ($a [' hello ']); The value of the false//key ' hello ' is equal to NULL, so it is considered to be an unassigned value. If you want to detect NULL key values, you can try the methods below. Var_dump (array_key_exists (' hello ', $a)); true//Checking Deeper Array valuesvar_dump (isset ($a [' Pie '] [' a ']); TRUE Var_dump (isset ($a [' Pie '] [' B ']); Falsevar_dump (isset ($a [' Cake '] [' a '] [' B ']);
Var_dump (isset ($a [' Pie '] [' a ']); and Var_dump (the isset ($a [' Cake '] [' a '] [' B ']); Please explain in detail, I have learned C language before, but I feel PHP is so difficult to understand.
Reply to discussion (solution)
Var_dump () printed meaning,
Array () to create a
The test=>1 test indicates that the array's key 1 represents the value of the array, followed by the
$a [test] is the value of the test key inside the array.
The value of a pie key in this array is also an array so $a is a two-dimensional array.
$a [Pie][a] is to take the Apple value inside the pie array inside this array.
Isset is the idea that there is no such value.
$a [' Cake '] [' a '] [' B '] an element of a multidimensional associative array
Although there is no associative key array in C, array elements such as a[1][2][3] are common.
Prints the value of a multidimensional array setting.
Var_dump () Print
$a [' Cake '] [' a '] [' B '] multidimensional array
Isset () sets the value
Determines whether the array is set if there is a corresponding key in the array true else false