I am attaching a PHP file that shows you how to pass PHP variable as input to cxcalc.
The sample uses the cxcalc command line tool, and communicates with pipes to standard input, output and error.
The sample file created on OS X, so you may need to edit the $cxcalc variable to point to your cxcalc executable.
Well i didn't thought about pipes, that's a good idea. I think it'll be fine and i will reuse it
I'm glad I could help you with that.