自定义函数问题

erldy 2006-08-01 05:52:32
用C写的一个自定义函数编译程.o文件后,能放到PHP的函数库中,然后写程序时像PHP自带函数那样调用吗?如果应该怎样把这个.o文件加入PHP的函数库中?高手倾指点!!谢谢
...全文
207 点赞 收藏 6
写回复
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()
回复
发动态
发帖子
基础编程
创建于2007-09-28

2.1w+

社区成员

从PHP安装配置,PHP入门,PHP基础到PHP应用
申请成为版主
社区公告
暂无公告