I seem to be stuck again! - I asked this question on friday which @Bartdude was great with answering - Array output and date format
This outputted an array like this -
[0]=> object(stdClass)#270 (3)
{
["Month(StartDate)"]=> string(1) "4"
["Year(StartDate)"]=> string(4) "2013"
["nrOfEvents"]=> string(2) "12"
}
[1]=> object(stdClass)#176 (3)
{
["Month(StartDate)"]=> string(1) "5"
["Year(StartDate)"]=> string(4) "2013"
["nrOfEvents"]=> string(2) "19"
}
[2]=> object(stdClass)#114 (3)
{
["Month(StartDate)"]=> string(1) "6"
["Year(StartDate)"]=> string(4) "2013"
["nrOfEvents"]=> string(2) "12"
}
}
Then after some searching through Stack Exchange I found this would return nrofEvents -
echo $results[0]->nrOfEvents
// Outputs - 12
I am struggling to understand how to access ["Month(StartDate)"] in the array in a foreach loop.
My end goal is to achieve a table of months that has a month name, for example
| Mar (12) | Apr(19) | Jun(12) |
| Jul(3) | Aug(4) | Sep(5) |
Any help in helping me understand would be fantastic and thanks in advance.