我基本上想檢查一個命令是否使用shell_exec
運行成功。Php檢查shell_exec命令是否成功
簡單的函數:
public static function foo()
{
$command = "blabla";
shell_exec($command);
}
編輯,我想先生M的建議是這樣的:
foreach($commands as $key => $value)
{
shell_exec($value, $output, $return);
}
而且我得到這個錯誤:
Undefined variable: output
我沒有定義$輸出也不$返回正確的嘗試? – utdev
不只是使用上面的代碼 –
我得到這個錯誤undefined變量$輸出 – utdev