将参数从php传递到批处理文件,反之亦然


Passing parameter from php to batch file and vise versa

我正试图将变量从php文件传递到批处理文件,并再次希望从批处理文件php文件获得输出。

我想我不能使用exec()或passthru(),因为没有传递参数选项。还有其他出路吗。

每当我需要从php执行一些东西时,我都会使用backticks。

$output = `my_script var1`;

请注意,这些不是单引号,而是反勾字符(位于键盘上"1"键的左侧)。

更多信息可在文档中找到:http://php.net/manual/en/language.operators.execution.php