php调用Linux系统命令
<span class="Apple-style-span" style="font-size: 12px; line-height: 22px; "><p>1、exec函数</p><p> <?php</p><p> $test = "ls /tmp/test"; //ls是linux下的查目录,文件的linux命令</p><p> exec($test,$array); //执行命令</p><p> print_r($array);</p><p> ?></p><p>2、system函数调用linux系统命令</p><p> <?php</p><p> $test = "ls /tmp/test";</p><p> $last = system($test);</p><p> print "last: $last\n";</p><p> ?></p></span>
页:
[1]