我有一個這樣的數組 -
Array
(
[0] => Array
(
[rest_id] => 1
[restname] => Baumgart's Cafe
[address] => 158 Franklin Avenue
[distance] => 20.3599115829
)
[1] => Array
(
[rest_id] => 2
[restname] => Brownstone Diner & Pancake Factory
[address] => 426 Jersey Avenue
[distance] => 12.422657991
)
[2] => Array
(
[rest_id] => 3
[restname] => Jacques Torres Chocolate
[address] => 285 Amsterdam Avenue
[distance] => 16.3264917908
)
[3] => Array
(
[rest_id] => 4
[restname] => Ed's Health Food
[address] => 150 Mountain Avenue
[distance] => 31.1066764629
)
我要作爲排序依據距離這個數組。 任何幫助表示讚賞。 Thnak你。
使用http://www.php.net/manual/en/function.usort.php? – 2011-09-20 05:37:42