system() function question

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
wwuster
Forum Newbie
Posts: 6
Joined: Sat Nov 08, 2008 6:01 am

system() function question

Post 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
User avatar
Jaxolotl
Forum Contributor
Posts: 137
Joined: Mon Nov 13, 2006 4:19 am
Location: Argentina and Italy

Re: system() function question

Post 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?
Post Reply