When doing something like
$output = shell_exec("command 2>&1");
collecting the command's stdout & stderr in $output
, is there a way to find the command's exit status?
One could write the command output to a temp file and then append the exit status, but that's rather clunky. Any better suggestions?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…