0) { $key=array_shift($ranks); if ($key>$current) return $key; } return 30; } /** * Returns the numeric value of the previous rank from the given array * * @param array $ranks The ranks * @param int $current The numeric value of the current rank * @return int The numeric value of the previous rank */ function clan_previousrank($ranks,$current) { $temp=array_pop($ranks); $ranks=array_keys($ranks); while (count($ranks)>0) { $key=array_pop($ranks); if ($key<$current) return $key; } return 0; } ?>