private static function nearest($number, $numbers)
    {
        $output = false;
        $number = (int)$number;
        if (is_array($numbers) && count($numbers) >= 1) {
            $NDat = array();
            foreach ($numbers as $n) {
                $NDat[abs($number - $n)] = $n;
            }
            ksort($NDat);
            $NDat = array_values($NDat);
            $output = $NDat[0];
        }
        return $output;
    }
private static function nearest($number, $numbers)
    {
        $output = false;
        $number = (int)$number;
        if (is_array($numbers) && count($numbers) >= 1) {
            $NDat = array();
            foreach ($numbers as $n) {
                $NDat[abs($number - $n)] = $n;
            }
            ksort($NDat);
            $NDat = array_values($NDat);
            $output = $NDat[0];
        }
        return $output;
    }
private static function nearest ( $ number , $ numbers ) { $ output = false ; $ number = ( int ) $ number ; if ( is_array ( $ numbers ) && count ( $ numbers ) >= 1 ) { $ NDat = array ( ) ; foreach ( $ numbers as $ n ) { $ NDat [ abs ( $ number - $ n ) ] = $ n ; } ksort ( $ NDat ) ; $ NDat = array_values ( $ NDat ) ; $ output = $ NDat [ 0 ] ; } return $ output ; }
Get the nearest number

@param int $number
@param array $numbers
@return int|bool nearest number false on error
Get the nearest number