|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2002-07-24 16:57 UTC] iliaa@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Oct 27 21:00:02 2025 UTC |
<? $rtdin = fopen("php://stdin", "r"); for(;;){ $c = fgetc($rtdin); fflush($rtdin); if ($c == 'q') break; else echo "you pressed:" . $c . "\n"; } ?> ========= This script doesn't work as expected: fgetc doesn't return until "\n" is read from stdin. How can I catch single key-presses from the keyboard?