Sure you can, and you don't to run a shell process for that. That code is PHP, and if you want to run it from PHP, all you need to do is include it.
Now, the only problem might be how you pass parameters into that script execution. You have 3 (probably more) possibilities:
Modify the script so it doesn't use $_GET for the parameters. I found 11 occurrences of "$_GET" in that file, so this should be easy. You have to check the license, though, if you are allowed to edit the file, and on which conditions.
Set the $_GET variables before including the script. $_GET is a superglobal, so it will be available in the script. But setting $_GET is considered bad practice as you might override some parameters you expect yourself, and in bigger projects this might cause strange results...
Look at the script you linked, look what is being done, and do it yourself. You will save a lot of code (you probably only need 30 of the 300 lines of that file to do what you want) and it will be your own code with which you may do whatever you want. Just don't copy if the license prohibits that. Only crib :P
The latter option is IMHO the best way, because you learn how to do it yourself correctly.*