note 35337 deleted from wrappers by vincent
| From: | vincent@php.net | Date: | Thu, 28 Aug 2003 11:13:07 +0000 |
| Subject: | note 35337 deleted from wrappers by vincent | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-55221@lists.php.net to get a copy of this message | ||
Note Submitter: mistergingras//at//yahoo//dot//ca
----
i found this exemple in :
Chapter 23. Using PHP from the command line
i taugh it fitted better here
<?
function read ($length='255')
{
if (!isset ($GLOBALS['StdinPointer']))
{
$GLOBALS['StdinPointer'] = fopen ("php://stdin","r");
}
$line = fgets ($GLOBALS['StdinPointer'],$length);
return trim ($line);
}
// then
echo "Enter your name: ";
$name = read ();
echo "\nHello $name! Where you came from? ";
$where = read ();
echo "\nI see. $where is very good place.";
?>
good thanks to punk [_at_] studionew [_dot_] com