command line interface - Get user input in PHP CLI without pressing Enter key -


i want ask user multiple questions in php cli script.

the answer 1 character z.

currently have following code , user has hit enter after each answer:

$handle = fopen ("php://stdin","r"); $char   = fgetc($handle); // <-- line waits enter 

i want second line wait first character, not enter.


Comments