I have an array like this:
array(31) {
["2018-01-15"]=>
float(13585.9013)
["2018-01-16"]=>
float(11348.02)
["2018-01-17"]=>
float(11141.2488)
["2018-01-18"]=>
float(11250.6475)
["2018-01-19"]=>
etc..
To get the value float
I do:
foreach ($array as $item) {
echo $item;
}
How can I get the date, which I think is the 'index' of the array inside the loop? This is the expected output:
2018-01-18
11250.6475
It's simple, it's part of the foreach syntax