The results of the popen,passthru,proc_open,shell_exec return are as follows:
[Root@krlcgcms01 shell]# php test.php 1001.log 10.log 10.tar.gz aaa.tar.gz mytest test1101 test1102 weblog_2010_09 I can find it. On these functions, can execute the command under Linux, I think there should be, welcome to add.
In general, you will rarely use PHP to execute Linux commands, but in special cases you may be using 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 a lot of, combined with the contents of the manual, the following 6 functions.
1,exec function
The returned results are 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 www.bkjia.com true http://www.bkjia.com/PHPjc/444815.html techarticle ? php Tutorial $test = ls/tmp/test; $out = Shell_exec ($test); echo $out; Popen,passthru,proc_open,shell_exec returns the following results: [root@ Krlcgcms01 shell]# php test.php 1001.log 1 ...