public function askChoice($prompt, $options, $default = null)
    {
        if ($options && is_string($options)) {
            if (strpos($options, ',')) {
                $options = explode(',', $options);
            } elseif (strpos($options, '/')) {
                $options = explode('/', $options);
            } else {
                $options = [$options];
            }
        }

        $printOptions = '(' . implode('/', $options) . ')';
        $options = array_merge(
            array_map('strtolower', $options),
            array_map('strtoupper', $options),
            $options
        );
        $in = '';
        while ($in === '' || !in_array($in, $options)) {
            $in = $this->_getInput($prompt, $printOptions, $default);
        }

        return $in;
    }
public function askChoice($prompt, $options, $default = null)
    {
        if ($options && is_string($options)) {
            if (strpos($options, ',')) {
                $options = explode(',', $options);
            } elseif (strpos($options, '/')) {
                $options = explode('/', $options);
            } else {
                $options = [$options];
            }
        }

        $printOptions = '(' . implode('/', $options) . ')';
        $options = array_merge(
            array_map('strtolower', $options),
            array_map('strtoupper', $options),
            $options
        );
        $in = '';
        while ($in === '' || !in_array($in, $options)) {
            $in = $this->_getInput($prompt, $printOptions, $default);
        }

        return $in;
    }
public function askChoice ( $ prompt , $ options , $ default = null ) { if ( $ options && is_string ( $ options ) ) { if ( strpos ( $ options , ',' ) ) { $ options = explode ( ',' , $ options ) ; } elseif ( strpos ( $ options , '/' ) ) { $ options = explode ( '/' , $ options ) ; } else { $ options = [ $ options ] ; } } $ printOptions = '(' . implode ( '/' , $ options ) . ')' ; $ options = array_merge ( array_map ( 'strtolower' , $ options ) , array_map ( 'strtoupper' , $ options ) , $ options ) ; $ in = '' ; while ( $ in === '' || ! in_array ( $ in , $ options ) ) { $ in = $ this -> _getInput ( $ prompt , $ printOptions , $ default ) ; } return $ in ; }
Prompts the user for input based on a list of options, and returns it.

@param string $prompt Prompt text.
@param string|array $options Array or string of options.
@param string|null $default Default input value.
@return mixed Either the default value, or the user-provided input.
Prompts the user for input based on a list of options and returns it .