1

我希望通过数组的“时间戳”部分从最低到最高(ASC)订购以下数组。

Array
(
[188] => Array
    (
        [date] => 28-04-2012
        [timestamp] => 1335571200
        [opposition] => Rayleigh 1st XI
        [teaperson] => 
    )

[182] => Array
    (
        [date] => 08-03-2012
        [timestamp] => 1331164800
        [opposition] => Galleywood 1st XI
        [teaperson] => 33
    )

[180] => Array
    (
        [date] => 07-07-2012
        [timestamp] => 1341619200
        [opposition] => High Roding 1st XI
        [teaperson] => 45
    )

)

我见过 array_multisort 函数,但不确定如何正确使用它。

干杯

4

1 回答 1

1

采用usort

usort($arr,function($a,$b) {return $a['timestamp']-$b['timestamp'];})
于 2012-04-24T20:58:11.640 回答