In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-21 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
Editor to share with you what is the use of the system function in php, I believe most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to know it!
The system function in php is used to execute the external program and displays the output, using syntax such as "system (string $command, int & $return_var =?): string", which executes the command specified by the command parameter and outputs the execution result.
This article operating environment: Windows7 system, PHP7.1 version, Dell G3 computer.
System (PHP 4, PHP 5, PHP 7, PHP 8)
System-executes external programs and displays output
Description
System (string $command, int & $return_var =?): string
Like the C version of the system () function, this function executes the command specified by the command parameter and outputs the execution result.
If PHP is running in the server module, the system () function also attempts to automatically flush the output cache of the web server after each line has been output.
If you want to get the raw output of a command without any processing, use the passthru () function.
Parameters.
Command
The order to be carried out.
Return_var
If the return_var parameter is provided, the return state after the execution of the external command will be set to this variable.
Return value
Returns the last line of the command output for success and false for failure.
Sample system () routine
Annotation
When passing user-supplied data into this function, you should use escapeshellarg () or escapeshellcmd () to prevent the user from spoofing the system into executing arbitrary commands.
Note:
How to start a program using this function? in order to keep running in the background, the program must redirect the output to a file or other output stream. Otherwise, it will cause PHP to hang until the end of program execution.
These are all the contents of the article "what is the use of system functions in php". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.