in reply to Re: How to get 2nd highest value from an array?
in thread How to get 2nd highest value from an array?

Well the code above prints value-1 of the last element not the value of the next to last element. In an array of sequential numbers the result may be the same ie element 9 contains value 9.

So the print statement becomes

print sort($arr[$#arr-1]);
?