I am extracting the name of each element from https://api.coinmarketcap.com/v2/ticker/
I'm doing this as so:
$foo = json_decode($foo, true);
$name = $foo['data'][`1`]['name'];
Which will give me Bitcoin
. But how do I move onto the next element? Right now I am physically setting the ['1']
to be 1 which is Bitcoin. And as you can see from the data, its all random numbers to. Its not 1, 2, 3, 4. Its 1, 1027, 52 etc. So Essentially, do I do access the next element?