【发布时间】:2013-02-13 17:28:23
【问题描述】:
我正在为一家音乐推广公司制作网站。对于每个艺术家,我都有一个包含事件信息的单独数组,如下所示:
<?php
$donevents = array();
$donevents[101] = array(
"date" => "March 18th 2013",
"artist" => "Don Ross",
"venue" => "The Half Moon, Putney",
"link" => "http://www.halfmoon.co.uk",
"label" => "donross",
);
$donevents[102] = array(
"date" => "March 19th 2013",
"artist" => "Don Ross",
"venue" => "The Moon Club, Cardiff",
"link" => "http://www.themoonclub.net/",
"label" => "donross",
);
$donevents[103] = array(
"date" => "March 21st 2013",
"artist" => "Don Ross and Brooke Miller",
"venue" => "Round Midnight, London",
"link" => "http://www.roundmidnightbar.com",
"label" => "donross",
);
$donevents[104] = array(
"date" => "March 21st 2013",
"artist" => "Don Ross",
"venue" => "Masterclass at the Swindon Academy of Music",
"link" => "http://www.academyofmusic.ac.uk/locations/location.php?id=9",
"label" => "donross",
);
$donevents[105] = array(
"date" => "March 23rd 2013",
"artist" => "Don Ross",
"venue" => "Berits & Brown, Airdrie",
"link" => "http://www.intimate-gigs.com",
"label" => "donross",
);
$donevents[106] = array(
"date" => "March 25th 2013",
"artist" => "Don Ross",
"venue" => "Masterclass at The Academy of Music, Gateshead",
"link" => "http://www.guitarbar.co.uk",
"label" => "donross",
);
?>
我想使用包含将所有这些单独的数组组合到一个事件页面中,并按时间顺序排列它们。有没有办法用“日期”关联数组来做到这一点?
所以它最终会是这样的: 2013 年 3 月 18 日 唐·罗斯 半月,普特尼
2013 年 3 月 20 日 布鲁克米勒 流浪汉,布里真德
2013 年 3 月 29 日 吉米·沃尔斯汀 车库,斯旺西
【问题讨论】:
-
所有“数组排序数组”问题的重复。
-
你有没有做出任何努力?
标签: php arrays date sorting associative