Reputation: 87
After a json_decode
this is the var_dump
of the assoc array:
array(1) {
[0]=> array(8) {
["Username"]=> string(11) "test"
["FirstName"]=> string(6) "Test1"
["LastName"]=> string(5) "Test2"
["Gender"]=> string(6) "Male"
}
}
if try to echo $array["FirstName"]
it doesn't display anything, I've tried everything and nothing works.
Upvotes: 0
Views: 155
Reputation: 324740
That's because there is no such key as FirstName
on the main array. However, there is one on the inner array.
echo $array[0]['FirstName'];
Note that if you had enabled show_errors
and had suitable error_reporting
set, you would have seen a Notice-level error informing you of the problem.
Upvotes: 2