Php 批处理文件返回没有意义
我有一个带有简单回显的批处理文件(Php 批处理文件返回没有意义,php,batch-file,Php,Batch File,我有一个带有简单回显的批处理文件(batch.bat) `ECHO Hello world` 然后我使用php捕获输出,但是输出不是我所期望的 C:\wamp\www\postEnginInstruction>ECHO Hello world Hello world 为什么我不仅得到了《你好世界》 PHP $output = shell_exec('batch.bat'); print_r($output); 尝试使用: @ECHO Hello world 它还
batch.bat
)
`ECHO Hello world`
然后我使用php捕获输出,但是输出不是我所期望的
C:\wamp\www\postEnginInstruction>ECHO Hello world Hello world
为什么我不仅得到了《你好世界》
PHP
$output = shell_exec('batch.bat');
print_r($output);
尝试使用:
@ECHO Hello world
它还捕获命令。在长批处理文件中,通常要执行以下操作:
@ECHO OFF
...
因此,不显示命令,只显示输出。您是如何执行此命令并在PHP中显示输出的?