FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » Pipe the content of a variable to a process
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Pipe the content of a variable to a process [message #173018] Thu, 17 March 2011 19:27 Go to previous message
Marco is currently offline  Marco
Messages: 11
Registered: March 2011
Karma:
Junior Member
Hi,

how can I pipe the content of a variable into a process' standard input and
save its output into another variable?

To make it clear what I want to achieve here's a small bash example that
processes the data »foo« with the process »sed« and writes the output into the
variable OUT.

IN='foo'
OUT=`echo $IN | sed 's/o/a/g'`

I need to do the same in PHP, pipe the data from $IN (a PHP variable) through
a process into $OUT (also a PHP variable).


Marco
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: use of array_key_exists() to prevent duplicates?
Next Topic: $_POST not set on 404
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Mon Nov 25 18:17:59 GMT 2024

Total time taken to generate the page: 0.08160 seconds