Var_dump (isset ($a [' Cake '] [' a '] [' B ']); What do you mean?

Source: Internet
Author: User
  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

  • Related Article

    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: 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.