How to make an interactive shell script in PHP
Basically, the function fgets with input STDIN will cause the script to pause and wait for the user to enter some text and hit enter.
<?php
echo "Please enter your name: ";
$name = fgets(STDIN);
echo "\nThanks, you entered: {$name}\n";
?>
echo "Please enter your name: ";
$name = fgets(STDIN);
echo "\nThanks, you entered: {$name}\n";
?>
http://www.sitepoint.com/article/php-command-line-1 »
[Click to add or edit comments])
Please prepend comments below including a date