2

In Python, you can add instruction on user input like this;

foo = input('Enter a number:')

Is there any way to do the same thing in PHP?

  • 3
    Possible duplicate of [Reading line by line from STDIN](https://stackoverflow.com/questions/11968244/reading-line-by-line-from-stdin) – Amadan Jul 18 '18 at 04:58

1 Answers1

4

The PHP readline() function does this:

<?php
$foo = readline('Enter a number:');
echo $foo;
?>

Read more about it here.

ahmedbatty
  • 29
  • 1
  • 3
  • 9
Jean Carlo Machado
  • 1,480
  • 1
  • 15
  • 25