public function getInput($query){

		if(function_exists('readline'))
           $line = readline($query);

        if(!function_exists('readline')){

			echo($query);

			$stdin = fopen('php://stdin', 'r');
			$line = fgets($stdin);
		}

		if(function_exists("readline_add_history"))
			readline_add_history($line);

		return $line;
	}
public function getInput($query){

		if(function_exists('readline'))
           $line = readline($query);

        if(!function_exists('readline')){

			echo($query);

			$stdin = fopen('php://stdin', 'r');
			$line = fgets($stdin);
		}

		if(function_exists("readline_add_history"))
			readline_add_history($line);

		return $line;
	}
public function getInput ( $ query ) { if ( function_exists ( 'readline' ) ) $ line = readline ( $ query ) ; if ( ! function_exists ( 'readline' ) ) { echo ( $ query ) ; $ stdin = fopen ( 'php://stdin' , 'r' ) ; $ line = fgets ( $ stdin ) ; } if ( function_exists ( "readline_add_history" ) ) readline_add_history ( $ line ) ; return $ line ; }
Interactive unmasked input

Note: uses readline extenstion
history enabled

@param string $query prompt text

@return string
Interactive unmasked input