Is it possible to get input from a user using php cli and then dump the input into a variable and then the script goes ahead.
Just like the c++ cin func
In this example I'm extending Devjar's example. Credits for him for example code. Last code example is simplest and safest in my opinion.
When you use his code:
You should note stdin mode is not binary-safe. You should add "b" to your mode and use following code:
Also you can set max charters. This is my personal example. I'll suggest to use this as your code. It's also recommended to use directly STDIN than "php://stdin".