Array accessing problem


Joined
Sep 12, 2022
Messages
3
Reaction score
0
PHP:
I am trying to access Gold in the array below. My answer is echo $treasure_hunt[3][2][1][0]; yet the correct answer is [3][4][2][0];. What's the detailed explanation of this?
$treasure_hunt = ["garbage", "cat", 99, ["soda can", 8, ":)", "sludge", ["stuff", "lint", ["GOLD!"], "cave", "bat", "scorpion"], "rock"], "glitter", "moonlight", 2.11];
 
Ad

Advertisements


Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top