The get_loaded_extensions Function
The get_loaded_extensions
function returns an array with the names of all extensions
that are currently loaded in PHP. This function does not take parameters
and can be useful for checking the available capabilities of PHP on the server.
Syntax
get_loaded_extensions([bool $zend_extensions = false]);
Example
Get a list of all loaded extensions:
<?php
$res = get_loaded_extensions();
print_r($res);
?>
Code execution result:
['Core', 'date', 'libxml', 'openssl', 'pcre', 'zlib', ...]
Example
Get only Zend extensions:
<?php
$res = get_loaded_extensions(true);
print_r($res);
?>
Code execution result:
['Zend OPcache', 'Xdebug']
See Also
-
the
extension_loaded
function,
which checks if a specific extension is loaded -
the
get_extension_funcs
function,
which returns the functions of the specified extension