自定义函数问题

erldy 2006-08-01 05:52:32
用C写的一个自定义函数编译程.o文件后,能放到PHP的函数库中,然后写程序时像PHP自带函数那样调用吗?如果应该怎样把这个.o文件加入PHP的函数库中?高手倾指点!!谢谢
...全文
235 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
erldy 2006-08-03
  • 打赏
  • 举报
回复
找到一个详细的资料,有兴趣的朋友,都看看吧。
用c写php扩展
http://bbs.7880.com/read-htm-tid-9621-fpage-1-toread--page-1.html
颓废的老猫 2006-08-02
  • 打赏
  • 举报
回复
dl
(PHP 3, PHP 4 , PHP 5)

dl -- Loads a PHP extension at runtime
Description
int dl ( string library)


Loads the PHP extension given by the parameter library. The library parameter is only the filename of the extension to load which also depends on your platform. For example, the sockets extension (if compiled as a shared module, not the default!) would be called sockets.so on Unix platforms whereas it is called php_sockets.dll on the Windows platform.

如果成功则返回 TRUE,失败则返回 FALSE。 If the functionality of loading modules is not available (see Note) or has been disabled (either by turning it off enable_dl or by enabling 安全模式 in php.ini) an E_ERROR is emitted and execution is stopped. If dl() fails because the specified library couldn't be loaded, in addition to FALSE an E_WARNING message is emitted.

Use extension_loaded() to test whether a given extension is already available or not. This works on both built-in extensions and dynamically loaded ones (either through php.ini or dl()).

The dl() function is dperecated as of PHP 5. Use Extension Loading Directives method instead.

这是我从手册上抄来的,还有例子你自己查手册吧
caaclxf 2006-08-02
  • 打赏
  • 举报
回复
关注.....
erldy 2006-08-01
  • 打赏
  • 举报
回复
楼上朋友的见笑了,只是为了实现特殊的功能,才需要这样做,但是不知道是否可行?

不知道这位朋友 zeroleonhart(Strong Point:Algorithm) 说的是什么意思?能说具体点吗?

颓废的老猫 2006-08-01
  • 打赏
  • 举报
回复
呵呵,楼主牛,自己写php的扩展。
zeroleonhart 2006-08-01
  • 打赏
  • 举报
回复
zend api
dl()

21,886

社区成员

发帖
与我相关
我的任务
社区描述
从PHP安装配置,PHP入门,PHP基础到PHP应用
社区管理员
  • 基础编程社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧