Returns a list of all modules in the system.
public static list_modules ( ) : array | ||
return | array | A list of all modules in the system. |
$modules = get_loaded_extensions(); foreach ($modules as $module) { echo "$module\n"; }
if (in_array('mysql', get_loaded_extensions())) { echo "MySQL module is loaded!"; } else { echo "MySQL module is not loaded!"; }This code will check if the MySQL module is currently loaded in PHP and output a message accordingly. It's not possible to determine the package library using the list_modules function alone. However, you can check the PHP documentation or use a package manager such as Composer to find more information about specific modules and their packages.
public static list_modules ( ) : array | ||
return | array | A list of all modules in the system. |