PHP: Get a specified number of characters from the keyboard without echoing to the screen

PHP Code
 function UIQuiet_Chars($CharCount = 1) {
		/*
		Purpose
			Used to get a specified number of characters from the keyboard without echoing the typed characters to the screen.
			This function does not drop to the next line when it returns.
		Parameters
			CharCount (int) = The number of characters we will get before automatically returning.
				Default: 1
				Entry Requirements: This must be >= 1.
		Return (string)
			Returns the entire string that the user typed.
		Notes
			This function returns after the user has entered the number of characters specified in CharCount.
			This function will not return whitespace characters.
		Dependencies
			This function works only within the Bash shell.
		Version History
			1.0 2012.04.04  Tested by Russ Tanner on PHP 5.3.10.
		*/

		$Cmd = "/usr/bin/env bash -c 'read -n " . $CharCount . " -s x && echo \$x'";
		return rtrim(shell_exec($Cmd));

	}
 


The Captian
Today they call you "crazy". Tomorrow they call you "ahead of your time."
Global Skywatch Learn about Chemtrails - You're breathing them now!
OnlyTheBestHerbs.com World-class supplements
Mercury Talk Why you are sick.
OneUp Domains Domains, Hosting, Email
1-800-358-4278 (U.S. & Canada)