protected function askQuestion($question, $choices, $default)
	{
		// Ask until we get a valid response
		do
		{
			echo $question.' '.$choices.': ';
			
			$handle = fopen("php://stdin", "r");
			$line = fgets($handle);

			$response = trim($line);

			// Use default when no response is given
			if (empty($response))
				$response = $default;
		}
		while (!in_array($response, explode('/', $choices)));

		return $response;
	}
protected function askQuestion($question, $choices, $default)
	{
		// Ask until we get a valid response
		do
		{
			echo $question.' '.$choices.': ';
			
			$handle = fopen("php://stdin", "r");
			$line = fgets($handle);

			$response = trim($line);

			// Use default when no response is given
			if (empty($response))
				$response = $default;
		}
		while (!in_array($response, explode('/', $choices)));

		return $response;
	}
protected function askQuestion ( $ question , $ choices , $ default ) { // Ask until we get a valid response do { echo $ question . ' ' . $ choices . ': ' ; $ handle = fopen ( "php://stdin" , "r" ) ; $ line = fgets ( $ handle ) ; $ response = trim ( $ line ) ; // Use default when no response is given if ( empty ( $ response ) ) $ response = $ default ; } while ( ! in_array ( $ response , explode ( '/' , $ choices ) ) ) ; return $ response ; }
Prompts the user for a response
@param string $question the question to ask
@param string $choices the available choices
@param string $default the default choice when no input is entered
@return string the choice
Prompts the user for a response