Solution: Prompt for getting input inside of anywhere code:
<?php
echo "What do you want to input? ";
$input = rtrim(fgets(STDIN));
echo "I got it:\n" . $input;
Sample output:
# php test.php
What do you want to input? Hello, I'm here!
I got it:
Hello, I'm here!
I hope this helps you.