我有一个像这样的数组:
Array
(
[0] => Jan
[1] => Feb
[2] => Mar
[3] => Apr
[4] => May
[5] => Jun
[6] => Sep
[7] => Oct
[8] => Dec
)
我需要将其转换为
Array
(
[0] => "Jan - Jun"
[1] => "Sep - Oct"
[2] => "Dec"
)
月份总是有序的,但由于数组是动态的,我想不出一个好的有效方法,除了用 date_parse 将每个月转换为数字,然后与它周围的月份结合!但我真的很困惑如何做到这一点,有什么想法吗?