public static function random($min, $max = null)
    {
        if (String::isEmpty($max) ||
            $max > getrandmax()) {
            $max = getrandmax();
        }

        return rand($min, $max);
    }
public static function random($min, $max = null)
    {
        if (String::isEmpty($max) ||
            $max > getrandmax()) {
            $max = getrandmax();
        }

        return rand($min, $max);
    }
public static function random ( $ min , $ max = null ) { if ( String :: isEmpty ( $ max ) || $ max > getrandmax ( ) ) { $ max = getrandmax ( ) ; } return rand ( $ min , $ max ) ; }
Generate random number

@param int $min Minimum value
@param int $max Maximum value

@return int
Generate random number