<p>does anybody know how could I get the TWO most largest values from the third column on the following array?</p>

<pre><code>$ar = array(array(1, 1,   7.50,   'Hello'),
              array(1, 2,  18.90,   'Hello'),
              array(3, 5,  11.50,   'Hello'),
              array(2, 4,  15.90,  'Hello'));
</code></pre>

<p>Output should be:</p>

<pre><code>15.90
18.90
</code></pre>

<p>Thanks in advance</p>

If you're sure that the value (two) will never change, just iterate over the array and keep track of the two largest numbers. If not, sort the arrays using
```
usort
```
()
and providing an appropriate callback. Then take the first two values:
```
```
function cmp($a, $b) {
    $a = $a[2];
    $b = $b[2];
    return $a == $b ? 0 : $a < $b ? 1 : -1;
}

usort($ar, 'cmp');
```
```