Can PHP and C++ pass data between each other?

后端 未结 11 1774
悲哀的现实
悲哀的现实 2020-12-14 20:36

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

11条回答
  •  星月不相逢
    2020-12-14 20:56

    From what i know the best solution would be writing PHP extension in C++.

    This gives you possibility to create your own 'native' PHP function which you will name my_func(). And it will do all calculations you need with speed of C++ application and return you result as output from my_func().

    You may want to look at this question: How to start writing a PHP5 extension in C++

提交回复
热议问题