note 49937 deleted from function.readline by hholzgra
| From: | hholzgra@php.net | Date: | Thu, 02 Aug 2012 12:38:55 +0000 |
| Subject: | note 49937 deleted from function.readline by hholzgra | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-189688@lists.php.net to get a copy of this message | ||
Note Submitter:
----
I have my own readline function for Windows:
<?php
function readline($prompt="") {
echo $prompt;
$o = "";
$c = "";
while ($c!="\r"&&$c!="\n") {
$o.= $c;
$c = fread(STDIN, 1);
}
fgetc(STDIN);
return $o;
}
?>
With many of the other functions posted above, it will only work once, and will immediately return
while returning nothing afterwards.
----
Me;)