I have a lot of mathematical calculations in my PHP script, which can be quite slow at times. I\'m wondering if it\'s possible to pass data from PHP to C++, do the calculati
You can do this, and this is a common solution to improve performance of performance-critical code. You can create a command line application in C++, and execute it using PHP's exec
command (or something similar).
As for passing data, you have a few options. If it's a lot of data, you can put it in a file using PHP, and access that file from C++. If it's less data, you can simply pass in command line arguments when you run the C++ program.