Brief introduction
The ReadLine extension function implements the interface for accessing the GNU ReadLine library. These functions provide a command line that can be edited. An example is a Bash that allows you to use the arrow keys to insert characters or to flip through historical commands. Because of the interactivity of this library, this feature is not very useful in the WEB program you write, but it is very helpful when you write a script that is used on the command line.
Installation configuration
If you want to use the ReadLine function, you must install Libreadline, and you can use a non-GPL Libedit library instead of the ReadLine library.
To use these functions, you must enable readline support when compiling the CGI or CLI version of PHP. You need to use the--with-readline[=dir] option when compiling PHP configuration. If you want to use Libedit instead of ReadLine, configure PHP with the--with-libedit[=dir] option
Related functions
Readline_add_history-adding a line of command-line history
readline_callback_handler_install-Initializes a ReadLine callback interface, and the terminal outputs a prompt and returns immediately
readline_callback_handler_remove-Remove the callback function handle from the previous installation and restore the terminal settings
Readline_callback_read_char-reads a character when a row is received and notifies ReadLine to call the callback function
readline_clear_history-Clear History
readline_completion_function-Registering a completion function
Readline_info-get/Set individual variables inside the ReadLine
readline_list_history-Get Command History list
Readline_on_new_line-notifies ReadLine to move the cursor to a new line
readline_read_history-Read Command history
readline_redisplay-Redraw the display area
readline_write_history-Write History
readline-reading a line