Can someone explain how I can send STDIN to a process and read its STDOUT?
The only function I could find in the manual that seemed relevant was popen(), but the manual says that it is unidirectional only.
There must be a better way than than writing to a temp file and calling the process via popen("process < tmpfile", "r") ... I hope.
Could someone provide a simple example of the best way to do this? Suppose, for example, I have a paragraph of text contained in variable $text, and I want to pass this to the STDIN of a binary called 'program' and read its STDOUT back into PHP4.
Thanks...