exec
(PHP3, PHP4)
EXEC---&http://www.aliyun.com/zixun/aggregation/37954.html ">nbsp; Executing an external program
Syntax: string exec (String command [, string array [, int return_var]])
Description:
EXEC () executes the command commands given, but it does not output anything, it simply returns the last line from the result of the command, and if you need to execute a command and get all the data from the command, you can use the PassThru () function.
If a parameter array is given, the specified array is filled with each row that the command outputs. Note: If the array has previously contained elements, EXEC () will append it to the array, if you do not want the function to append elements, you can pass this array to exec () Call Unset () before.
If a parameter array and Return_var are given, the state command to return execution will be written to this variable.
Note: If you allow data from user input to be passed to this function, you should use Escapeshellcmd () to determine that this user cannot spoof (trick) the system to execute arbitrary (arbitrary) commands.
Note: If you use this function to start a program and you want to leave it in the background (background), you must make sure that the output of the program is turned (redirected) to a file or some output stream, otherwise PHP will hang (hang) Until the program execution is finished.
Reference: System () PassThru () Popen () Escapeshellcmd ()