I am working on a command-line-script witch uses fread (for yes/no,...) and fgets (for manually validating values,...).
The problem is if I enter more than ... chars ( is a char, too), this chars are already inputed in the next fgets/fread-function.
I tried fflush(STDIN), but it didn't work. I also tried stream_get_line(STDIN,1024); which was recommended by someone in a simmelar question, but then I have to input nearly unendless much chars until the programm continues (I quit).
How to get PHP to delete keyboard-buffer before using fgets/fread?