How can the "require_once" function be used effectively in PHP to prevent function redeclaration issues?

The "require_once" function in PHP can be used effectively to prevent function redeclaration issues by ensuring that a file is only included and executed once in a script. This helps avoid conflicts that can arise when a function is declared multiple times in different files that are included in the same script.

// Include the file containing the function using require_once
require_once 'functions.php';

// Call the function without worrying about redeclaration issues
myFunction();