How can hooks be used in PHP development to allow for easy extension of existing modules?

Hooks can be used in PHP development to allow for easy extension of existing modules by providing predefined entry points in the code where additional functionality can be added without modifying the original code. This allows developers to easily add new features or modify existing ones without the need to directly edit the core code, making the application more maintainable and flexible.

// Define a hook function
function my_custom_hook() {
    // Add your custom functionality here
}

// Call the hook at the desired location in the existing module
my_custom_hook();