I was "googling" about PHP and Octave and I had found some simple approach at a mailing list archive. I had already used Octave with PHP but I had always used temporary files, but pipes are a much simpler approach.
From the mailing list post:
start "octave -q script" with popen
create a string in php e.g. "input_data = [102 10 10 10 10 10];"
write this string to the pipe
recive the string with fread on stdin
let the eval function do the job
print the result with printf in php syntax "$result = array(12,10,9,12,)"
read the output from the pipe (with php fread)
use phps eval function
but using eval with octave and php is a security risk, to avid eval parse
the matrix wird scanf
this is also not the fastes way to use octave (the octave startup needs a
lot of time)