Var_dump (isset ($ a ['Cake'] ['A'] ['B?

Source: Internet
Author: User
Var_dump (isset ($ a [cake] [a] [B]); what does it mean? 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']); // FALSE // The value of the key 'hello' is NULL, so it is considered as an unset value. // If you want to check the NULL key value, try the following method. 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']); // FALSE?>

Var_dump (isset ($ a ['Pie '] ['A']); and var_dump (isset ($ a ['Cake'] ['A'] ['B? I have learned C language before, but I think php is so hard to understand ..


Reply to discussion (solution)

Meaning of var_dump () printing,
Array () to create an array
Test => 1 test indicates that the key 1 of the array represents the value of the array, and so on.
$ A [test] is the value of the test key in the array.
The pie key value in this array is also an array, so $ a is a two-dimensional array.
$ A [pie] [a] is the apple value in the pie array in this array.
Isset is used to determine whether the value does not exist.


$ A ['Cake'] ['A'] ['B'] an element of the multi-dimensional join array
Although C does not have an associated key array, array elements such as a [1] [2] [3] are still very common, right?

Print the value of the multi-dimensional array.
Var_dump () printing
$ A ['Cake'] ['A'] ['B'] multi-dimensional array
Whether isset () is set

Checks whether the array is set. If the array has a corresponding key, true else false

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.