How to read user or console input in PHP?
In PHP, the console is a command-line interface, which is also called an interactive shell. We can access it by typing the following command in a terminal:
If we type any PHP code in the shell and hit enter, it is executed directly and displays the output or shows the error messages in case of any error. A sample run of a PHP code, that reads input from the…