Home >php教程 >php手册 >PHP函数extension_loaded()用法实例,extensionloaded

PHP函数extension_loaded()用法实例,extensionloaded

WBOY
WBOYOriginal
2016-06-16 09:16:421425browse

PHP函数extension_loaded()用法实例,extensionloaded

本文实例讲述了PHP函数extension_loaded()用法。分享给大家供大家参考。具体分析如下:

extension_loaded — 检查一个扩展是否已经加载

例如:

复制代码 代码如下:

if (!extension_loaded('gd')) {
    if (!dl('gd.so')) {
        exit;
    }
}
?>


上述代码判断是否加载 gd 库扩展。

补充:

查看php已开启扩展的方法:

命令行cmd界面:

输入:php -m
显示结果如下:

复制代码 代码如下:

[PHP Modules]
bcmath
bz2
calendar
com_dotnet
ctype
curl
date
dom
filter
ftp
gd
hash
iconv
json
libxml
mbstring
mcrypt
mysql
mysqli
odbc
pcre
PDO
pdo_mysql
PDO_ODBC
pdo_sqlite
Reflection
session
SimpleXML
sockets
SPL
SQLite
standard
tokenizer
wddx
xml
xmlreader
xmlwriter
Zend Optimizer
zip

[Zend Modules]

希望本文所述对大家的php程序设计有所帮助。

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn