Re: stdout as input

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

 



----- Original Message ----
> From: Christoph Boget <christoph.boget@xxxxxxxxx>
> To: PHP General <php-general@xxxxxxxxxxxxx>
> Sent: Thursday, September 24, 2009 6:51:56 AM
> Subject:  stdout as input
> 
> 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

Isn't it simpler with
http://www.php.net/manual/en/function.shell-exec.php
?


-- 
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