Submit Tips/Quickies

Application Architecture : Miscellaneous

User input in php command line

Submitted By: Jiju Thomas Mathew
Date: 02/15/07 14:13

The following piece of code will help capture user input when writing command line php scripts.

 function getInput($msg){
          fwrite(STDOUT, “$msg: “);
          $varin = trim(fgets(STDIN));
          return $varin;
   }
http://www.php-trivandrum.org


Comments:

No Messages Found

You can post questions/corrections/feedback here

 

If you are looking for help, please post on the appropriate forum here. Your questions will be answered much more quickly.

Add A Comment:

Name:

Email:

Subject:

Message:

To reduce spam posts, messages are now manually approved

You are not [logged in]. That means your account will not get credit for this post.