exec()的手册显示您可以提供可选的第三个参数来收集返回状态(退出代码).类似于system(),第二个可选参数.
该页面的示例:
Run Code Online (Sandbox Code Playgroud)<?php echo '<pre>'; // Outputs all the result of shellcommand "ls", and returns // the last output line into $last_line. Stores the return value // of the shell command in $retval. $last_line = system('ls', $retval); // Printing additional info echo ' </pre> <hr />Last line of the output: ' . $last_line . ' <hr />Return value: ' . $retval; ?>
| 归档时间: |
|
| 查看次数: |
2924 次 |
| 最近记录: |