Re: how to read the stuff that got piped ("|") to the script?
| From: | Joe Stump | Date: | Wed, 28 May 2003 00:42:38 +0000 |
| Subject: | Re: how to read the stuff that got piped ("|") to the script? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-149177@lists.php.net to get a copy of this message | ||
If you're on any UNIX:
<?
$fp = fopen('/dev/stdin','r');
if($fp)
{
while(!feof($fp))
{
$line = trim(fgets($fp,4096));
echo $line."\n";
}
}
?>
On Tuesday, May 27, 2003, at 06:17 PM, Marco Weber wrote:
hi, i've a simple question: how can i read the stuff that got piped ("|") to the php-script? i.e. "ls -l | /home/myuser/phpscript.php" thanks in advance for any help Marco Weber -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php --Joe Stump - joe@joestump.net http://www.jerum.com "Software never has bugs. It just develops random features."