What best practices should be followed to prevent redeclaration errors in PHP functions?

To prevent redeclaration errors in PHP functions, it is important to check if a function already exists before declaring it. This can be done using the `function_exists()` function to ensure that a function is only declared if it does not already exist.

if (!function_exists('my_function')) {
    function my_function() {
        // Function implementation
    }
}