PHP|PHP 里面的数组按照某个时间字段排序
https://blog.csdn.net/u012015434/article/details/48153847
$store_list = Array
(
[0] => Array
(
[name] => asdf
【PHP|PHP 里面的数组按照某个时间字段排序】[head] => /upload/thumbs/20150814220142_27630.jpg
[img] =>
[content] => asdfasdfasdf
[datetime] => 2015-10-11 09:55:08
[flag] => false
)
[1] => Array
(
[name] => 基本原则顶替
[head] =>
[img] =>
[content] => 基本原则顶替
[datetime] => 2015-09-01 10:41:08
[flag] => true
)
[2] => Array
(
[name] => ad
[head] => /upload/thumbs/20150814220142_27630.jpg
[img] =>
[content] => asdfasdf
[datetime] => 2015-09-01 09:51:08
[flag] => false
)
)
foreach($sort_list as $key=>$v){
$sort_list[$key]['datetime'] = date("YmdHis",strtotime($v['datetime']));
}
$datetime = array();
foreach ($sort_list as $user) {
$datetime[] = $user['datetime'];
}
array_multisort($datetime,SORT_DESC,$sort_list);
print_r()
推荐阅读
- 你到家了吗
- 闲杂“细雨”
- 村里的故事|村里的故事 --赵大头
- 情节33.0
- 生命过客——第10章|生命过客——第10章 初为人母
- 你眼里的不公平,其实很公平
- 画廊百里若江南
- thinkphp|thinkphp 3.2 如何调用第三方类库
- 抱着梦的无眠
- CGI,FastCGI,PHP-CGI与PHP-FPM