Getting $n number of maximum values
- by KPL
Hello all,
Straight to the question -
If $n = 3,
and input is -
Array
(
[04] => 3
[07] => 4
[01] => 5
[06] => 5
[05] => 5
[03] => 6
[08] => 6
[02] => 7
[09] => 8
[12] => 9
[10] => 10
[15] => 10
[19] => 11
[20] => 11
[13] => 12
[21] => 12
[16] => 13
[14] => 14
[22] => 14
[23] => 15
[11] => 15
[00] => 15
[17] => 17
[18] => 17
)
Output should be -
Array
( [14] => 14
[22] => 14
[23] => 15
[11] => 15
[00] => 15
[17] => 17
[18] => 17
)
Thank you, all, for help.