note 60759 deleted from function.readline by tularis
| From: | tularis@php.net | Date: | Mon, 16 Jan 2006 07:51:50 +0000 |
| Subject: | note 60759 deleted from function.readline by tularis | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-101900@lists.php.net to get a copy of this message | ||
Note Submitter: haukew at gmail dot com
----
A readline for ux systems without gnu-readline. (KISS)
function readline($prompt="")
{
print $prompt;
$out = "";
$key = "";
$key = fgetc(STDIN); //read from standard input (keyboard)
while ($key!="\n") //if the newline character has not yet arrived read another
{
$out.= $key;
$key = fread(STDIN, 1);
}
return $out;
}