在PHP exec中使用变量

Ata*_*man 1 php exec

我想在我的PHP exec函数中使用我的变量:

exec('ffmpeg -i $audio_input $audio_output');
Run Code Online (Sandbox Code Playgroud)

这样做的正确方法是什么?我不想改变ffmpeg脚本.可能吗?

谢谢

jVa*_*ron 15

使用双引号而不是单引号:

exec("ffmpeg -i $audio_input $audio_output");
Run Code Online (Sandbox Code Playgroud)

,请阅读此页:http://php.net/manual/en/language.types.string.php