如何在php exec()中传递参数?

I am trying to run a .exe application with input file and argument.

With cmd I can successfully start the executable like this...

C:\Program Files\MyApp.exe "path\to\input file" argument

However, nothing happens when I simply copy paste the string above into the exec() function like this..

exec("C:\Program Files\MyApp.exe "path\to\input file" argument") 

Do I need to escape parts of the string? How should I proceed?

Just pass the arguments like a normal calling from shell

ex:

exec("C:\Program Files\MyApp.exe \"path to\input file\" argument") 

I had to use this format

php -q "./yii.php" migrate/up --interactive=0 --migrationPath=@vendor/pheme/yii2-settings/migrations