我似乎被卡住了! - 我问这个问题,上周五其@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