Mixing Lua and PHP?
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.
精彩评论