PHP运行批处理<.bat>文件或者结束服务器进程

32 views
Skip to first unread message

unread,
Jun 22, 2011, 11:35:39 AM6/22/11
to Weber
可以用system()、exec()、passthru()

string system ( string command [, int &return_var] )

string exec ( string command [, array &output [, int &return_var]] )

void passthru ( string command [, int &return_var] )

没错啊,比如你要在用户访问1.php的时候执行服务器上的 c:\a.bat 你可以在1.php里面这么写

<?php
exec("c:\\a.bat");
?>

Reply all
Reply to author
Forward
0 new messages