Question: I tried to get the 2nd highest value from an array and I simply want to know if it is possible to do something like MAX -1 OR I absolutely need to sort by table and the 2nd highest value 

```
private function max_key($array) {
    foreach ($array as $key => $val) {
    if ($val == max($array))  return $key;
    }
    }

```

Answer: 
`max($array) - 1` isn't going to work. I would do something like:

```
$array = arsort($array);
return isset( $array[1] ) ? $array[1] : FALSE;

```
I don't think you will find a MAX - 1 function. Probably need to do a type of sort, then take the second position in the sorted array.