Page 1 of 1

system() function question

Posted: Sat Nov 08, 2008 6:08 am
by wwuster
I have a script that runs the system() function. I can get the executed command's output in a string that system() returns, which is what I want. But when system() runs I also get the same text on the screen. I'd like to have it only in the string and not see it on the screen. Is there a way to do that? I tried redirecting to /dev/null but that returns empty strings also.

thanks,
William

Re: system() function question

Posted: Sat Nov 08, 2008 7:20 am
by Jaxolotl
From the manual http://php.net/manual/en/function.system.php
The system() call also tries to automatically flush the web server's output buffer after each line of output if PHP is running as a server module.

Is it the problem?