/**
* 执行shell脚本
* @param $shell shell脚本命令
* @param false $is_print 是否打印过程
*/
function startshell($shell, $is_print = false)
{
if ($is_print) {
//shell=》shell命令,status=》执行结果的状态,0为成功
echo "<pre>";
system($shell, $status);
echo "</pre>";
} else {
//shell=》shell命令,result=》执行结果的过程,status=》执行结果的状态,0为成功
exec($shell, $result, $status);
}
if ($status) {
return false;
} else {
return true;
}
} 如果帮助到你,请赏杯奶茶喝~
- 本文链接: https://www.shx1024.top//index/article/details/article_id/70.shtml
- 版权声明:本博客所有文章除特别声明外,均默认采用 许可协议。