我似乎被卡住了! - 我問這個問題,上週五其@Bartdude是偉大的回答 - Array output and date format對象(stdClass)數組和返回值
此輸出這樣的數組 -
[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"
}
}
後,一些通過協議棧交易所搜索然後我發現這將返回nrofEvents -
echo $results[0]->nrOfEvents
// Outputs - 12
我很努力去理解如何在foreach循環中訪問數組中的[「Month(StartDate)」]。
我的最終目標是實現月表具有月份名稱,例如
| Mar(12)| Apr(19)| Jun(12)|
| 7月(3)| 8月(4)| Sep(5)|
幫助我理解的任何幫助都會非常棒,並且會提前致謝。
HI @Silkfire - 謝謝你,在我發現你最容易與我的知識水平一起工作的所有解決方案中,通過一些'if'陳述,我已經能夠將它大致地放在我想要的地方。謝謝。 – Andy
不客氣。 – silkfire