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 ()
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.