What are some best practices to avoid redeclaring functions in PHP?

To avoid redeclaring functions in PHP, it is important to check if a function already exists before declaring it. This can be done using the `function_exists()` function. By checking if the function exists before declaring it, you can prevent conflicts and errors that may arise from redeclaring the same function.

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