1

I want to use my variables in my PHP exec function:

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

What is the right way of doing this? I dont want to change the ffmpeg script. Is it possible?

Thanks

Ataman
  • 2,530
  • 3
  • 22
  • 34

3 Answers3

15

Use double quotes instead of single quotes:

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

But please, go read this page: http://php.net/manual/en/language.types.string.php

jValdron
  • 3,408
  • 1
  • 28
  • 44
1

Replace with double quotes:

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

Check the manual for Strings here.

Community
  • 1
  • 1
Praveen Kumar Purushothaman
  • 164,888
  • 24
  • 203
  • 252
0

Use double quotes like mentioned before or

exec('ffmpeg -i '.$audio_input.' '.$audio_output);
Nashi
  • 76
  • 6