PHP cli getting input from user and then dumping into variable possible? -
is possible input user using php cli , dump input variable , script goes ahead.
just c++ cin
function ?
is possible if yes how ? maybe not php maybe linux commands ?
thanks
have @ php manual page http://php.net/manual/en/features.commandline.php
in particular
<?php echo "are sure want this? type 'yes' continue: "; $handle = fopen ("php://stdin","r"); $line = fgets($handle); if(trim($line) != 'yes'){ echo "aborting!\n"; exit; } echo "\n"; echo "thank you, continuing...\n"; ?>
Comments
Post a Comment