note 9744 deleted from function.fgetc by irc-html
| From: | irc-html@php.net | Date: | Thu, 03 Jan 2002 02:25:44 +0000 |
| Subject: | note 9744 deleted from function.fgetc by irc-html | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-24334@lists.php.net to get a copy of this message | ||
I was in dalnet's #Linux channel at 6am and sleep deprivation made an op and I realize that
infact, you could open STDIN and STDOUT with php for console operations.
/dev/stdout, /dev/stdin, and basicly any other /dev/ listing.
This is for unix based systems, athough you should be able to open \std or \STD on windows
installations.
Function Readln(){
$info_IN = fopen("/dev/stdin","r");
while (!feof($info_IN)) {
$IN = fgetc($info_IN);
if ($IN == "n"){
echo $IN;
}
}
fclose($info_IN);
}
Pretty nifty huh?