stdout as input

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I've read the section in the docs about i/o streams and other related
sections I was able to find but couldn't figure out how to do what I
need.  From the command line, I'm trying to pipe stdout in to my php
script which should then see it as input.  A simplistic example would
be:

echo bob | myScript.php

In myScript.php, I'm doing:

  $handle = popen( 'php://stdin', 'r' );
  echo var_export( $handle, TRUE ) . "\n\n";

I've also tried php://stdout and php://input.  I also tried eschewing
the php:// pseudo protocol and popen altogether and going with the
STDIN and STDOUT constants.  None of that worked.  Is there a way I
can pipe/redirect output from a command line uhh, command as input to
my script?

thnx,
Christoph

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux