Re: read input in console mode
| From: | Mathieu Dumoulin | Date: | Thu, 06 Feb 2003 14:54:49 +0000 |
| Subject: | Re: read input in console mode | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-134613@lists.php.net to get a copy of this message | ||
Nope, it returns 1 character from the input buffer after the user presses
enter
sadly, i did try that already!
=P
-------------------------
"Adam Voigt" <adam@cryptocomm.com> a écrit dans le message de news:
1044542994.1653.9.camel@beowulf.cryptocomm.com...
$f = fopen("php://stdin","r");
$command = fread($f,1);
fclose($f);
Would that not read a single character?
On Thu, 2003-02-06 at 09:41, Mathieu Dumoulin wrote:
Hi there,
I found a way to read input from a console mode in linux, very simple open
php://stdin to read from the standard input system. THE PROBLEM is i can't
just read one character it always waits for the user to press enter which is
not what i intended to do.
When i write "Please press a key to continue" if the user presses anything
else than enter it appears on the screen. and the input ends only when he
presses enter. If you are a C/C++ programmer you can compare that to the cin
>>> command.
I need something to read only one char at a time if needed!
thank you
Mathieu Dumoulin
Programmer analyste for web solutions-
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub
--
Adam Voigt (adam@cryptocomm.com)
The Cryptocomm Group
My GPG Key: http://64.238.252.49:8080/adam_at_cryptocomm.asc