user2650277
user2650277

Reputation: 6739

exec() command with quotes not working

My exec command looks like

exec("program.exe -x arg -o "something" $url");

Notice that here that something MUST be in double quotes or else the command won't work

I tried the following but all failed

exec("program.exe -x arg -o \"something\" $url");

exec('program.exe -x arg -o "something" $url');

Upvotes: 0

Views: 66

Answers (2)

user2650277
user2650277

Reputation: 6739

In fact i already had the correct answer

exec("program.exe -x arg -o \"something\" $url");

Works Perfect.

Most probably these alternatives work great as well

exec('program.exe -x arg -o' . '"something"' . $url);

OR

exec('program.exe -x arg -o "something" ' . $url);

Actually i have mistype the command and that's the reason why it was not working....

Upvotes: 0

CS GO
CS GO

Reputation: 912

exec('program.exe -x arg -o' . '"something"' . $url);

OR

exec('program.exe -x arg -o "something" ' . $url);

Upvotes: 1

Related Questions