1

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

exec('ffmpeg -i $audio_input $audio_output');

这样做的正确方法是什么?我不想更改 ffmpeg 脚本。是否可以?

谢谢

4

3 回答 3

15

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

exec("ffmpeg -i $audio_input $audio_output");

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

于 2012-12-14T11:59:54.397 回答
1

替换为双引号:

exec("ffmpeg -i $audio_input $audio_output");

在此处查看字符串的手册。

于 2012-12-14T12:00:00.157 回答
0

使用前面提到的双引号或

exec('ffmpeg -i '.$audio_input.' '.$audio_output);
于 2012-12-14T12:05:00.287 回答