9951 explained code solutions for 126 technologies


phpGet Command Line Input Mid-Runtime


echo "Enter a number:\n";
$input = readline('> ');
echo "Entered: " . $input;ctrl + c
echo "Enter a number:\n";

give the user a prompt

$input =

assign the input to the variable $input

readline(

reads what the user enters

'> '

a stylistic prompt (purely aesthetic)

echo "Entered: " . $input;

output what the user entered