title: PHP interaction with command line program
body: <p>I have a certain command line program which takes in input from the stream and not as command line arguments.(For example, a C program that takes input using scanf.) How can I interact with this app using PHP? exec(), shell_exec() wont help here since input is not through command line arguments. I need a constant input/output connection between the PHP script and the command line program, so that the user can give PHP an input, which PHP will relay to the program and then get the output, which is displayed to the user. </p>