note 23224 added to function.fgetc

From: Date: Fri, 12 Jul 2002 02:54:09 +0000
Subject: note 23224 added to function.fgetc
Groups: php.notes 
Request: Send a blank email to php-notes+get-32943@lists.php.net to get a copy of this message
i am using this example, which may or not be properly implemented. i'm running Redhat Linux 7.3 with the php standalone (cgi) version 4.1.2. <pre> $f = fopen("php://stdin", "r+"); set_file_buffer($f, 0); while(($c = fgetc($f)) != 'X') fputs($f, $c); fclose($f); </pre> i would think it would echo each typed char unless it was 'X'. it still waits for a \n, but now returns the entire line. this makes things like tab-completion and other neat cmdline tricks undo-able, unless i'm missing something obvious. which is, of course, very possible. -- http://www.php.net/manual/en/function.fgetc.php http://master.php.net/manage/user-notes.php?action=edit+23224 http://master.php.net/manage/user-notes.php?action=delete+23224 http://master.php.net/manage/user-notes.php?action=reject+23224

« previous php.notes (#32943) next »