开发者

Mixing Lua and PHP?

开发者 https://www.devze.com 2023-02-10 20:07 出处:网络
I really want to mix Lua and PHP, for example receive a PHP query and process some parts of the query using Lua scripts (being called fro开发者_如何转开发m the PHP script that got the initial query ).

I really want to mix Lua and PHP, for example receive a PHP query and process some parts of the query using Lua scripts (being called fro开发者_如何转开发m the PHP script that got the initial query ).

Any clues about this ? I've seen some libraries to use Lua as some kind of PHP replacement, but I've seen nothing clear about how to use both Lua and PHP together.

Thanks


Have you seen phplua? It looks like it could do what you want. I found it via the Lua binding-with-other-languages page (it was the only relevant option, for better or worse).


There is now a full PECL extension for embedding and interacting with Lua code.

See http://pecl.php.net/package/lua and http://www.php.net/manual/en/book.lua.php


I assume you aren't feeling up to embedding lua in PHP which leaves running lua as an external script and reading the result. That's a pretty common operation and this page provides some guidance.

0

精彩评论

暂无评论...
验证码 换一张
取 消