PHP 选项/信息 函数
在线手册:中文 英文
PHP手册

get_loaded_extensions

(PHP 4, PHP 5)

get_loaded_extensionsReturns an array with the names of all modules compiled and loaded

说明

array get_loaded_extensions ([ bool $zend_extensions = false ] )

This function returns the names of all the modules compiled and loaded in the PHP interpreter.

参数

zend_extensions

Only return Zend extensions, if not then regular extensions, like mysqli are listed. Defaults to FALSE (return regular extensions).

返回值

Returns an indexed array of all the modules names.

更新日志

版本 说明
5.2.4 The optional zend_extensions parameter was added

范例

Example #1 get_loaded_extensions() Example

<?php
print_r
(get_loaded_extensions());
?>

以上例程的输出类似于:

Array
(
   [0] => xml
   [1] => wddx
   [2] => standard
   [3] => session
   [4] => posix
   [5] => pgsql
   [6] => pcre
   [7] => gd
   [8] => ftp
   [9] => db
   [10] => calendar
   [11] => bcmath
)

参见


PHP 选项/信息 函数
在线手册:中文 英文
PHP手册
PHP手册 - N: Returns an array with the names of all modules compiled and loaded

用户评论:

todesw1nd at hotmail dot com (24-Mar-2012 08:18)

if you want to sort the extensions from a to z the easiest way is to use natcasesort.

satya61229 at satya-weblog dot com (30-Aug-2010 03:33)

I was not sure of the Zend extensions. and no zend extensions was coming on my installation. print_r(get_loaded_extensions(true)); print zend extensions loaded.
To know the zend extensions loaded in you installation, use phpinfo() and check where it says "This program makes use of ...". It is the third section in output.
If you have Xdebug installed and enabled then this is a zend extension and it will be listed there.