- function cmp($a, $b) {
- if ($a['weight'] == $b['weight']) {
- return 0;
- }
- return ($a['weight'] < $b['weight']) ? 1 : -1;
- }
- usort($result,'cmp');
- //该片段来自于http://www.codesnippet.cn/detail/2605201512673.html
来源: http://www.codesnippet.cn/detail/2605201512673.html