分類或組陣列我有一個按日期倒序這樣的分組歷史列表:如何通過日期
-----------
28/Feb/2014
-----------
27/Feb/2014
-----------
27/Feb/2014
-----------
27/Feb/2014
------------
26/Feb/2014
------------
26/Feb/2014
我要打印這樣的。
-----------
28/Feb/2014
-----------
27/Feb/2014
27/Feb/2014
27/Feb/2014
------------
26/Feb/2014
26/Feb/2014
這裏是我的數組:
array(
(int) 0 => array(
'BriefHistory' => array(
'id' => '2',
'created' => '2014-02-28 14:51:08',
'created_by' => '7827',
'order_id' => 'OBE10003',
'brief_instalment_id' => '2',
'brief_history_type_id' => '1'
)
),
(int) 1 => array(
'BriefHistory' => array(
'id' => '4',
'created' => '2014-02-27 16:18:40',
'created_by' => '7827',
'order_id' => 'OBE10003',
'brief_instalment_id' => '2',
'brief_history_type_id' => '4'
)
),
(int) 2 => array(
'BriefHistory' => array(
'id' => '1',
'created' => '2014-02-27 14:51:08',
'created_by' => '7827',
'order_id' => 'OBE10003',
'brief_instalment_id' => '1',
'brief_history_type_id' => '1'
)
),
(int) 3 => array(
'BriefHistory' => array(
'id' => '3',
'created' => '2014-02-26 16:18:09',
'created_by' => '7827',
'order_id' => 'OBE10003',
'brief_instalment_id' => '1',
'brief_history_type_id' => '3'
)
)
)
PHP:
<?php foreach ($briefHistories as $briefHistorie) { ?>
<div class="brief-summary-row">
<div>
<?php echo TimeUtil::format("d/M/Y", $briefHistorie['BriefHistory']['created']); ?>
</div>
</div>
<?php } ?>
對不起這不起作用 – Fury