For example
$arr = ['9','3','34','334','56','89', '559', '8','876'];
sort($arr);
$total = count($arr);
foreach($arr as $key=> $val){
if($key == $total-2 ){ print_r($val);
}