Re: [PHP] how to read the stuff that got piped ("|") to the script?

2003-05-27 Thread Joe Stump
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

Re: [PHP] how to read the stuff that got piped (

2003-05-27 Thread Alex Earl
> 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" [snip] It is the stdin of the script, you can open that file handle with fopen( "stdin", "r" ); i believe Slide -- PHP General Mailing List (http: