public static function select($text, $options = array())
    {
        top:
        static::stdout("$text [" . implode(',', array_keys($options)) . ",?]: ");
        $input = static::stdin();
        if ($input === '?') {
            foreach ($options as $key => $value) {
                echo " $key - $value\n";
            }
            echo " ? - Show help\n";
            goto top;
        } elseif (!in_array($input, array_keys($options))) goto top;
        return $input;
    }
public static function select($text, $options = array())
    {
        top:
        static::stdout("$text [" . implode(',', array_keys($options)) . ",?]: ");
        $input = static::stdin();
        if ($input === '?') {
            foreach ($options as $key => $value) {
                echo " $key - $value\n";
            }
            echo " ? - Show help\n";
            goto top;
        } elseif (!in_array($input, array_keys($options))) goto top;
        return $input;
    }
public static function select ( $ text , $ options = array ( ) ) { top : static :: stdout ( "$text [" . implode ( ',' , array_keys ( $ options ) ) . ",?]: " ) ; $ input = static :: stdin ( ) ; if ( $ input === '?' ) { foreach ( $ options as $ key => $ value ) { echo " $key - $value\n" ; } echo " ? - Show help\n" ; goto top ; } elseif ( ! in_array ( $ input , array_keys ( $ options ) ) ) goto top ; return $ input ; }
Gives the user an option to choose from. Giving '?' as an input will show
a list of options to choose from and their explanations.

@param string $text    Prompt string
@param array  $options Key-value array of options to choose from

@return string An option character the user chose
Gives the user an option to choose from . Giving ? as an input will show a list of options to choose from and their explanations .