zhengsenlin888 发表于 2011-12-22 08:54

php调用Linux系统命令

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