开发者

Batch file run using PHP works but only displays last line

I have a batch file that displays a list of registry keys.

10000 20000 30000 40000 ..etc.

Using PHP, I can display the output of the batch file:

echo exec('file.bat');

This only shows me 40000 though, not the other three entries. How can I see every开发者_运维百科thing?


Use shell_exec() instead.


exec() returns the last line from STDOUT. You can pass a second parameter to capture all of the STDOUT.

exec($command, $output = array());

Then all of the output text will be in $output.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜