I have an array within an array and am trying to access tokenName in it but failing. I have done json_decode and get the entire array. I have the capability of getting status and message but nothing within the third element 'result' which itself is another array. That is is the main issue here.
Here is the array:
Array (
[status] => 1
[message] => OK
[result] => Array (
[0] => Array (
[contractAddress] => 0x3845badAde8e6dFF049820680d1F14bD3903a5d0
[tokenName] => SAND
[symbol] => SAND
[divisor] => 18
[tokenType] => ERC20
[totalSupply] => 3000000000
[blueCheckmark] => true
[description] => The Sandbox is a virtual world where players can build, own, and monetize their gaming experiences in the Ethereum blockchain using SAND, the platform’s utility token.
[website] => http://www.sandbox.game/
[email] => contact@sandbox.game
[blog] => XX
[reddit] =>
[slack] =>
[facebook] => XX
[twitter] => XX
[bitcointalk] =>
[github] => XX
[telegram] => https://t.me/sandboxgame
[wechat] =>
[linkedin] => XX
[discord] => XX
[whitepaper] => https://installers.sandbox.game/The_Sandbox_Whitepaper_2020.pdf
[tokenPriceUSD] => 1.290000000000000000
)
)
)
and the following attempts are not returning anything and what I have tried so far:
$curl_jason = json_decode($curl_response, true);
echo $curl_jason->message;
echo $curl_jason[3][0];
echo $curl_jason->result[telegram];
print_r($curl_jason[result][1]->tokenName);
$variab = array_column($curl_jason, 'tokenName');
print_r($variab);
How do I access tokenName
as an example and print it out?