public function getResponse($question, $params = array())
    {
        $params = $this->cleanParamsAndPrintPrompt($question, $params);
        $response = str_replace(array("\n", "\r"), array("", ""), $this->input());
        return $this->validateResponse($response, $question, $params);
    }
public function getResponse($question, $params = array())
    {
        $params = $this->cleanParamsAndPrintPrompt($question, $params);
        $response = str_replace(array("\n", "\r"), array("", ""), $this->input());
        return $this->validateResponse($response, $question, $params);
    }
public function getResponse ( $ question , $ params = array ( ) ) { $ params = $ this -> cleanParamsAndPrintPrompt ( $ question , $ params ) ; $ response = str_replace ( array ( "\n" , "\r" ) , array ( "" , "" ) , $ this -> input ( ) ) ; return $ this -> validateResponse ( $ response , $ question , $ params ) ; }
A function for getting answers to questions from users interractively.
This function takes the question and an optional array of parameters.
The question is a regular string and the array provides extra information
about the question being asked.

The array takes the following parameters

**answers**
An array of posible answers to the question. Once this array is available
the user would be expected to provide an answer which is specifically in
the list. Any other answer would be rejected. The library would print
out all the possible answers so the user is aware of which answers
are valid.

**default**
A default answer which should be used in case the user does not supply an
answer. The library would make the user aware of this default by placing
it in square brackets after the question.

**required**
If this flag is set, the user would be required to provide an answer. A
blank answer would be rejected.

@param string $question The question you want to ask
@param array  $params   An array of options that this function takes.
@return string The response provided by the user to the prompt.
A function for getting answers to questions from users interractively . This function takes the question and an optional array of parameters . The question is a regular string and the array provides extra information about the question being asked .