<p>Does anybody knows how can I get the max and min value of the 2nd and 3rd columns in PHP?</p>

<pre><code>$ar = array(array(1,  10,   9.0,   'HELLO'),
            array(1,  11,  12.9,   'HELLO'),
            array(3,  12,  10.9,   'HELLO'));
</code></pre>

<p>Output should be like:</p>

<p>max(12.9)
min(10)</p>

```
```
<?php
$ar = array(array(1,  10,   9.0,   'HELLO'),
            array(1,  11,  12.9,   'HELLO'),
            array(3,  12,  10.9,   'HELLO'));
function col($tbl,$col){
    $ret = array();
    foreach ($tbl as $row){
        $ret[count($ret)+1] = $row[$col];
    }
    return $ret;
}
print (max(col($ar,2))."\n");
print (min(col($ar,1))."\n");
?>
```
```
is this what you look for? I guess its not the most efficient way.