标签:field font row foreach dir asc mount cti each
$result = array(
array(
"amount": "11.00",
"date": "2015.10.10",
"title": "缴纳会员费"
),
array(
"amount": "11.00",
"date": "2016.10.10",
"title": "缴纳会员费"
)
);
$sort = array(
‘direction‘ => ‘SORT_DESC‘, //排序顺序标志 SORT_DESC 降序;SORT_ASC 升序
‘field‘ => ‘date‘, //排序字段
);
$arrSort = array();
foreach($result AS $keys=> $row){
foreach($row AS $key=>$value){
$arrSort[$key][$keys] = $value;
}
}
if($sort[‘direction‘]){
array_multisort($arrSort[$sort[‘field‘]], constant($sort[‘direction‘]), $result);
}
print_r($result);
标签:field font row foreach dir asc mount cti each
原文地址:http://www.cnblogs.com/zhangbinwu/p/6043248.html