我有一个ourBank.dll文件。。请问php中如何加载
是否?
$bankObj= new com('ourBank.dll');
是否?
$bankObj= new com('ourBank.dll');
解决方案 »
- 通过delphi post数据到PHP+mysql服务器中存储,post后有什么方法能知道服务器已经处理成功;
- 做好的留言本 适合新手学习 偶
- 在PHP中,如何选定某一行,并把选定行对应的值传递给方本框中,如图:
- 每次都要右键,烦死了,求批处理方法执行版本管理。
- 一段分页代码!
- Excel表数据怎样利用WEB形式导入到MYSQL中!请帮忙!
- 在导入数据结构时为何会出现以下的错误呢?
- 会PHP+APACHE+MYSQL综合应用者不要错过赢分的好机会
- 在打开.php文件时,怎么直接看到了源代码?
- TO y10k 可以给一个简体转繁体的我吗?(flowerbacket)
- PHP切割字符串
- PHP导航栏
dl('ourBank.dll');
(PHP 4, PHP 5)dl — Loads a PHP extension at runtime说明
bool dl ( string $library )
Loads the PHP extension given by the parameter library. 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()). Warning
This function has been removed from some SAPI's in PHP 5.3. 参数library
This 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. The directory where the extension is loaded from depends on your platform: Windows - If not explicitly set in the php.ini, the extension is loaded from C:\php4\extensions\ (PHP4) or C:\php5\ (PHP5) by default. Unix - If not explicitly set in the php.ini, the default extension directory depends on whether PHP has been built with --enable-debug or not
whether PHP has been built with (experimental) ZTS (Zend Thread Safety) support or not
the current internal ZEND_MODULE_API_NO (Zend internal module API number, which is basically the date on which a major module API change happened, e.g. 20010901)
Taking into account the above, the directory then defaults to <install-dir>/lib/php/extensions/ <debug-or-not>-<zts-or-not>-ZEND_MODULE_API_NO, e.g. /usr/local/php/lib/php/extensions/debug-non-zts-20010901 or /usr/local/php/lib/php/extensions/no-debug-zts-20010901.
返回值
成功时返回 TRUE, 或者在失败时返回 FALSE. If the functionality of loading modules is not available or has been disabled (either by setting enable_dl off 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. 范例Example #1 dl() examples<?php
// Example loading an extension based on OS
if (!extension_loaded('sqlite')) {
if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
dl('php_sqlite.dll');
} else {
dl('sqlite.so');
}
}// Or, the PHP_SHLIB_SUFFIX constant is available as of PHP 4.3.0
if (!extension_loaded('sqlite')) {
$prefix = (PHP_SHLIB_SUFFIX === 'dll') ? 'php_' : '';
dl($prefix . 'sqlite.' . PHP_SHLIB_SUFFIX);
}
?>