F.30. Program Execution

FunctionReturnsDescription
exec(string command [, array &output [, int
 &return_value]])
stringExecutes an external program.
system(string command [, int &return_value])
intExecutes an external program and displays output.
passthru(string command [, int &return_value])
voidExecutes an external program and displays raw output.
escapeshellcmd(string command)
stringEscapes shell metacharacters.
escapeshellarg(string arg)
stringQuotes and escapes an argument for use in a shell command.
shell_exec(string cmd)
stringExecutes command via shell and returns complete output as string.
proc_nice(int priority)
boolChanges the priority of the current process.
proc_terminate(resource process [, long signal])
intKills a process opened by proc_open.
proc_close(resource process)
intCloses a process opened by proc_open.
proc_get_status(resource process)
arrayGets information about a process opened by proc_open.
proc_open(string command, array descriptorspec, array
 &pipes [, string cwd [, array env [, array other_options]]])
resourceRuns a process with more control over its file descriptors.

Get Web Standards Programmer's Reference: HTML, CSS, JavaScript®, Perl, Python®, and PHP now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.