Drupal tip: Print out a list of modules implementing a hook

When building or debugging a module sometimes it's helpful to know which modules are implementing a particular hook. 

Drupal 7:

// The name of the hook.
$hook = 'node_access';

// Print out all modules implementing this hook.
dpr(module_implements($hook));

Use dpr() if you have the Devel module enabled; otherwise use the PHP function print_r()

Example output:

Array
(
    [0] => node
    [1] => features
)