我已经被这个问题困扰了几天了。我似乎无法理解似乎应该是一个简单的问题。
这是数组,我想按温度对其进行排序。降序。
[0] => Array
(
[name] => Sandnes
[latitude] => 58.85244
[longitude] => 5.73521
[temperature] => 12.0
)
[1] => Array
(
[name] => Sola
[latitude] => 58.88854
[longitude] => 5.65285
[temperature] => 12.3
)
[2] => Array
(
[name] => Kleppe
[latitude] => 58.77303
[longitude] => 5.63329
[temperature] => 12.1
)
[3] => Array
(
[name] => Hommersåk
[latitude] => 58.93167
[longitude] => 5.85111
[temperature] => 11.3
)
[4] => Array
(
[name] => Ålgård
[latitude] => 58.76417
[longitude] => 5.85253
[temperature] => 10.9
)
[5] => Array
(
[name] => Stavanger
[latitude] => 58.97005
[longitude] => 5.73332
[temperature] => 11.9
)
[6] => Array
(
[name] => Tananger
[latitude] => 58.93618
[longitude] => 5.5741
[temperature] => 12.5
)
[7] => Array
(
[name] => Bryne
[latitude] => 58.73536
[longitude] => 5.64766
[temperature] => 12.4
)
我已经使用 PHP 附带的许多不同的排序功能尝试了多种不同的解决方案,但没有运气。
我见过这个问题的变体,但他们的答案总是各不相同。在尝试实施我见过的一些解决方案并失败后,我希望你们中的一些人可以提供帮助。