本文实例讲述了php的dl函数用法。分享给大家供大家参考。具体如下:
PHP的dl函数官网说明如下:
http://www.php.net/manual/en/function.dl.php
具体用法示例如下:
<?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); } ?> dl("memcache.so");
extension_dir = "/usr/local/php/lib/php/extensions/no-debug-non-zts-20060613/" ;extension=memcache.so
希望本文所述对大家的PHP程序设计有所帮助。