function ask($question, array $answers) {
		// question loop
		$optstr = implode("|", $answers);
		do {
			$this->printf("$question [$optstr] ");
			$answer = $this->fgets();
		}
		while ( ! in_array($answer, $answers));

		return $answer;
	}
function ask($question, array $answers) {
		// question loop
		$optstr = implode("|", $answers);
		do {
			$this->printf("$question [$optstr] ");
			$answer = $this->fgets();
		}
		while ( ! in_array($answer, $answers));

		return $answer;
	}
function ask ( $ question , array $ answers ) { // question loop $ optstr = implode ( "|" , $ answers ) ; do { $ this -> printf ( "$question [$optstr] " ) ; $ answer = $ this -> fgets ( ) ; } while ( ! in_array ( $ answer , $ answers ) ) ; return $ answer ; }
Shorthand for retrieving confirmation from console. Common console task
for input.

@return string answer
Shorthand for retrieving confirmation from console . Common console task for input .