add examples of 2nd/3rd array depths for isset() (doc #54251)

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@310529 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Peter Cowburn 2011-04-26 20:02:13 +00:00
parent 22ac47b4fe
commit 79069a88f1

View file

@ -114,7 +114,7 @@ var_dump(isset($foo)); // FALSE
<![CDATA[
<?php
$a = array ('test' => 1, 'hello' => NULL);
$a = array ('test' => 1, 'hello' => NULL, 'pie' => array('a' => 'apple'));
var_dump(isset($a['test'])); // TRUE
var_dump(isset($a['foo'])); // FALSE
@ -124,6 +124,11 @@ var_dump(isset($a['hello'])); // FALSE
// If you want to check for NULL key values then try:
var_dump(array_key_exists('hello', $a)); // TRUE
// Checking deeper array values
var_dump(isset($a['pie']['a'])); // TRUE
var_dump(isset($a['pie']['b'])); // FALSE
var_dump(isset($a['cake']['a']['b'])); // FALSE
?>
]]>
</programlisting>