In Python
, I know that to read the data entered by the command line we use the function raw_input
.
Example:
Python script:
print 'digite algo para inicializar'
resultado = raw_input()
print 'O resultado é ' + resultado
Command line:
> python script.py
digite algo para inicializar
> teste
o resultado é teste
What about PHP? How to make PHP read input from the command line?
Note : I want to capture the entry not at script startup, but "in the middle" of it, as in the example of python
, shown above.