module_exists

Definition

module_exists($module)
includes/module.inc, line 214

Description

Determine whether a given module exists.

Parameters

$module The name of the module (without the .module extension).

Return value

TRUE if the module is both installed and enabled.

Code

<?php
function module_exists($module) {
  $list = module_list();
  return array_key_exists($module, $list);
}
?>
 
 

All source code and documentation on this site is released under the terms of the GNU General Public License, version 2 and later. Drupal is a registered trademark of Dries Buytaert.