Php Exec() Vs Shell_exec() Vs Over System()
- Forums
- PHP
- Php Exec() Vs Shell_exec() Vs Over System()
If You Are Familiar With Php, Have You Ever Wondered What Is The Difference Between Exec(), Shell_exec() And System() [2092], Last Updated: Mon Jun 24, 2024
Phpdevlpr
Mon Feb 08, 2010
1 Comments
1478 Visits
if you are familiar with php, have you ever wondered what is the difference between exec(), shell_exec() and system()
if you have a way of telling me, please
this is what i have so far
exec — Execute an external program
exec() executes the given command .
shell_exec — Execute command via shell and return the complete output as a string
[This function is identical to the backtick operator. ]
system — Execute an external program and display the output
system() is just like the C version of the function in that it executes the given command and outputs the result.
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.
If you need to execute a command and have all the data from the command passed directly back without any interference, use the passthru() function.