Translate or interpret JavaScript with PHP

Any tips on running JavaScript code from PHP? I am trying to run a javascript function and get its return value. In this case, it is much easier than translating it to PHP. Could Spidermonkey be good for this task or something else?

UPDATE: On the other hand, if there is an application for translating JavaScript into PHP once instead of just interpreting it, it might be better. Therefore, I will be interested in recommendations on this front.

thanks a lot

+4
source share
1 answer

What about:

J4P5 (pretty simple) or V8JS (I haven't tried)

I think Spidermonkey can do the job too ... I only used very little J4P5, so I cannot offer too much.

+5
source

Source: https://habr.com/ru/post/1336401/


All Articles