I use php to get a string, ex : ‘3 * 2’ , and call java (by exec() )to compute this but even when I replace the ‘*‘ with ‘\*’ or not, it still didn’t work. When I pass these arguments to command line, it works for ‘\*’, not for ‘*’. How could I input asterisk so that the command line can understand ? I don’t want to change the way my program work with ‘‘ into st else in the java file. I am using Ubuntu.
Share
you can use escapeshellarg() in the php to escape your arguments