我正在寻找一种基于数组中包含的时间间隔来拆分数组的方法。例如,
Array (
[0] => Array (
['type'] => Text Format
['interval'] => 30
['init'] => 2012-04-30 09:00:00
['final'] => 2012-04-30 10:00:00
)
[1] => Array (
['type'] => Word Format
['interval'] => 12
['init'] => 2012-04-28 13:00:00
['final'] => 2012-04-28 13:30:00
)
)
将其拆分为:
Array (
[0] => Array (
['type'] => Text Format
['interval'] => 30
['init'] => 2012-04-30 09:00:00
['final'] => 2012-04-30 09:30:00
)
[1] => Array (
['type'] => Text Format
['interval'] => 30
['init'] => 2012-04-30 09:30:00
['final'] => 2012-04-30 10:00:00
)
[2] => Array (
['type'] => Word Format
['interval'] => 12
['init'] => 2012-04-28 13:00:00
['final'] => 2012-04-28 13:12:00
)
[3] => Array (
['type'] => Word Format
['interval'] => 12
['init'] => 2012-04-28 13:12:00
['final'] => 2012-04-28 13:24:00
)
)
这样做的好方法是什么?