Is there any way to perform an unbuffered read in PHP when reading from STDIN?

I.E. if I have the code

---------------------
$chr = "";
while(!feof(STDIN))
{
 $chr = fgetc(STDIN); //I could just as easily do fread(STDIN, 1)
 if($chr == " ")
   break;
}
---------------------

and enter the following string (note this is how you would enter the string in a program to have it have the same value I'd type in):
"this is a test\n"

It will stop reading at the newline, and not the first space.

Any ideas?


System Info
Environment: Windows XP Pro (used both the windows and cygwin command lines)
PHP Version: 5.0.3

Thanks
-Jim Stapleton
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to