PHPverse 2025

Voting

: max(nine, seven)?
(Example: nine)

The Note You're Voting On

Anonymous
7 years ago
If you call fgetc(HANDLE) multiple times you must clear buffer before, thus get all unwanted chars to the new new line character.

while (true) {

//clear buffer - read all unwanted characters
while(fgetc(STDIN) != "\n");

//get first character from STDIN
$first = fgetc(STDIN);
}

<< Back to user notes page

To Top