欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

PHP系統(tǒng)命令函數(shù)使用分析

 更新時(shí)間:2013年07月05日 08:55:39   作者:  
本篇文章是對(duì)PHP中系統(tǒng)命令函數(shù)的使用進(jìn)行了詳細(xì)的分析介紹,需要的朋友參考下
復(fù)制代碼 代碼如下:

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;
 }

相關(guān)文章

最新評(píng)論