我有以下数组:
Array
(
[0] => Array
(
[date] => 2012-01-10
)
[1] => Array
(
[date] => 2012-01-11
)
[2] => Array
(
[date] => 2012-01-12
)
[3] => Array
(
[date] => 2012-01-15
)
[4] => Array
(
[date] => 2012-01-18
)
[5] => Array
(
[date] => 2012-01-19
)
)
我想按他的范围结合日期。最后我需要类似下面的东西
Array
(
[0] => Array
(
[from] => 2012-01-10
[till] => 2012-01-12
)
[1] => Array
(
[from] => 2012-01-15
[till] => 2012-01-15
)
[2] => Array
(
[from] => 2012-01-18
[till] => 2012-01-19
)
)
但它也应该支持广泛的范围。2012-01-22 到 2012-05-14 之类的东西。任何人的想法或提示?