How can the visibility of a process be managed when using the exec function in PHP?

When using the exec function in PHP to run external commands, the visibility of the process can be managed by redirecting the output to a file or to /dev/null. This way, the output of the command will not be displayed on the screen, but can still be accessed later if needed.

// Redirect output to a file
exec('command > output.txt');

// Redirect output to /dev/null
exec('command > /dev/null');