Reputation: 21
I know that you can use PHP or node.js server-side, but is it possible to use both PHP and JS together, for example PHP calling a JS function?
My goal is to call JS for the more intensive math functions, but I don't want these to be seen on the clientside. I've tried searching many different sites but it seems my question is pretty specific. Thanks
Upvotes: 0
Views: 276
Reputation: 1074295
There are a couple of ways to do this:
Use some kind of bridging technology. The briefest search turned up this one, for instance. Edit: User blues mentions PHP V8js as well.
Have a Node process running and bound only to localhost, and have your PHP code make queries to it (perhaps via HTTP).
Upvotes: 2