Skip to content

qiye/lua-php-utils

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

lua-php-utils

PHP-style utility functions for LuaJIT applications

目前支持的php函数(相关函数均从PHP C源码中移植过来),使用方法请参考PHP手册(将不断的增加新PHP函数)

  1. str_pad
  2. genid 获取一个唯一的ID
  3. trim
  4. rtrim
  5. ltrim
  6. split
  7. strncmp
  8. explode
  9. hash(key, seed)
  10. ip2long
  11. long2ip
  12. ctype_upper
  13. ctype_lower
  14. ctype_alpha
  15. ctype_alnum
  16. ctype_lower
  17. ctype_digit
  18. addslashes
  19. stripslashesa
  20. xxtea_decrypt
  21. xxtea_encrypt

编译方法

gcc -O3 -shared -fPIC -I/usr/local/include/luajit-2.0/   -c -o php.o php.c
gcc -O3 -shared -fPIC -I/usr/local/include/luajit-2.0/ -ansi -pedantic -Wall -o php.so php.o

运行例子程序

luajit-2.0.2 test.lua

About

PHP-style utility functions for LuaJIT applications

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published