|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2001-12-15 22:23 UTC] yohgaki@php.net
[2001-12-16 05:46 UTC] yohgaki@php.net
[2002-08-23 21:53 UTC] sniper@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Oct 26 03:00:01 2025 UTC |
fgetc should have at least the option of returning a single charachter immediatly upon its entry, or another function should be defined (such as getchar()) that achieves similar functionality to fgetc(stdin) which return a single charachter immediatly. The following script allows the user to type more than a single charachter and only returns when the user hits enter. fgetc should simply block until a single charachter is entered and then return. This is missing functionality that can not be worked around easily as far as I can tell. Script: $fp = fopen("php://stdin", "r"); $char = fgetc($fp); echo $char;