PHP 捕获exec()输出

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了PHP 捕获exec()输出相关的知识,希望对你有一定的参考价值。

<?php

function execOutput($command) {
    $output = array($command);
    exec($command.' 2>&1', $output);
    return implode("\n", $output);
}

echo execOutput('help');
?>

以上是关于PHP 捕获exec()输出的主要内容,如果未能解决你的问题,请参考以下文章