In PHP, I can read in input from a command line program with the following code This works well for simple input. However, if I try to use something like an back arrow key, my shell looks like the following i.e., the arrow key escape sequence of ^[[D is sent to the shell. PHP itself will interpret the arrow keys
Tag: readline
Reading user command line input with PHP with readline, but bash is not default shell
I wrote a PHP script and I’m trying to read user input from the command line. I started of with which worked fine, but when typing the input the arrow keys didn’t work the way it should. I learned that this could be solved with the -e switch, so it became: Now this worked like a charm in my development