I do not know if it matters in this case but variables in double quotes are evaluated? but in single quotes they are treated literally.
Not a great example but you will get the idea:
Code: Select all
$input = 'image.jpg';
echo "The image is $input";
// Output: The image is image.jpg
echo 'The image is $input';
// Output: The image is $input
Also in the example we have to use " " with the exec and the " " around the 460x> would cause an error. So escaping them treats them as a " and not as the end of the exec command.
Not explained very well but that is how I understand it.
I also tend to err on the safe side when writing my code to make it easier to understand. We may have been able to get away with { } but I have never tried it.
For example when I have variables for the size this will cause an error $widthx$height but {$width}x{$height} is OK
I hope I have not confused you but I do not do a lot of programming now and have methods I have used for years that I know work!