Popen, passthru, proc_open, shell_exec return The results are as follows:
[root@krlcgcms01 shell]# php test.php 1001.log 10.log 10.tar.gz aaa.tar.gz mytest test1101 test1102 weblog_2 010_09 I can find out These are just a few functions that can execute commands under Linux. I think there should be more. Everyone is welcome to add.
Under normal circumstances, php is rarely used to execute Linux commands, but under special circumstances, you may use these functions. I used to know that there are two functions that can execute linux commands, one is exec and the other is shell_exec. In fact, there are many. Based on the content of the manual, the following 6 functions are introduced.
1. exec function
The return result is as follows:
[root@krlcgcms01 shell]# php ./exec. php array ( [0] => 1001.log [1] => 10.log [2] => 10.tar.gz [3] => aaa.tar.gz [4] => mytest [5] => test1101 [6] => test1102 [7] => weblog_2010_09 )
http://www.bkjia.com/PHPjc/444815.html