源码网商城,靠谱的源码在线交易网站 我的订单 购物车 帮助

源码网商城

PHP系统命令函数使用分析

  • 时间:2020-07-15 12:27 编辑: 来源: 阅读:
  • 扫一扫,手机访问
摘要:PHP系统命令函数使用分析
[u]复制代码[/u] 代码如下:
function execute($cmd) {      $res = '';      if ($cmd) {          if(function_exists('system')) {              @ob_start();              @system($cmd);              $res = @ob_get_contents();              @ob_end_clean();          } elseif(function_exists('passthru')) {              @ob_start();              @passthru($cmd);              $res = @ob_get_contents();              @ob_end_clean();          } elseif(function_exists('shell_exec')) {              $res = @shell_exec($cmd);          } elseif(function_exists('exec')) {              @exec($cmd,$res);              $res = join(“\n",$res);          } elseif(@is_resource($f = @popen($cmd,"r"))) {              $res = '';              while(!@feof($f)) {                  $res .= @fread($f,1024);              }              @pclose($f);          }      }      return $res;  }
  • 全部评论(0)
联系客服
客服电话:
400-000-3129
微信版

扫一扫进微信版
返回顶部