有人可以帮我吗?我想订购由密钥 '相对'按键排序
print_r ($items) will output:
Array(
[36] => Array
(
[id] => 36
[name] => mp4
[total_items] => 58
[rel] => 5.3015
)
[61] => Array
(
[id] => 61
[name] => mp3
[total_items] => 61
[rel] => 21.7269
)
[63] => Array
(
[id] => 63
[name] => avi
[total_items] => 43
[rel] => 2.254
)
)
此多维数组项[] 和我需要:第一[61] sencond [36]→[63]
谢谢您!
这应该被添加到PHP的标准库考虑到人们经常会问它在这里。 – 2011-05-18 18:57:17
@PMV因此'+ 1' :-) – Neal 2011-05-18 18:58:03
@PMV他们问,因为他们没有阅读文档;)有一个功能,可以让你做到这一点,而不需要太多的代码。使用[闭包](http://pl.php.net/manual/en/functions.anonymous.php)更简单。 – Tadeck 2011-05-18 19:03:54