Reputation: 744
In PHP when I do
var_dump($galleryCategoriesThumb);
Output is
array(1) {
[0]=>
array(1) {
["Gallery"]=>
array(3) {
["id"]=>
string(3) "190"
["photofile"]=>
string(6) "50.jpg"
["gallery_category_id"]=>
string(2) "58"
}
}
}
When I do
var_dump($galleryCategoriesThumb["photofile"]);
I get NULL output. I tried various other options also. All I want to do is echo ["photofile"]. Please help.
Upvotes: 2
Views: 80
Reputation: 14429
It is expected that var_dump($galleryCategoriesThumb["photofile"]) returns NULL because "photofile" key does not exist in $galleryCategoriesThumb.
To access "photofile", you need a 'full path' in the array as posted by others
var_dump($galleryCategoriesThumb[0]["Gallery"]["photofile"]);.
Upvotes: 1
Reputation: 721
Try var_dump($galleryCategoriesThumb[0]["Gallery"]["photofile"]);
.
It's a 3 dimensions array.
Upvotes: 1