codepad
[
create a new paste
]
login
|
about
Language:
C
C++
D
Haskell
Lua
OCaml
PHP
Perl
Plain Text
Python
Ruby
Scheme
Tcl
<?php $a = Array ( 1 => Array ( 'name' => 'Бананы', 'count' => 16 ), 2 => Array ( 'name' => 'Груши', 'count' => 12 ), 3 => Array ( 'name' => 'Яблоки', 'count' => 1 ), 4 => Array ( 'name' => 'Апельсины', 'count' => 1 ), 5 => Array ( 'name' => 'Мандарины', 'count' => 5 ), ); function cmp($a, $b){ return $a['count'] - $b['count']; } usort($a, 'cmp'); print_r($a);
Private
[
?
]
Run code
Submit