If you have ever started out writing PHP CLI, you may notice it's kinda hard to find information about how to get input to and back from the user.
Here is a simple function which will allow you to ask the user for input and then return the input.
<?
function getInput($msg){
print "$msg \n";
$handle = fopen ("php://stdin","r");
$line = fgets($handle);
return trim($line);
}
#!/usr/bin/php
<?php