What common issue might occur when including a function in a separate PHP file and calling it from another file?
One common issue that might occur when including a function in a separate PHP file and calling it from another file is that the function may be redefined if the include statement is used multiple times. This can lead to a "Cannot redeclare function" error. To solve this issue, you can use the `require_once` statement instead of `include` to ensure that the file is only included once.
// File containing the function (functions.php)
function myFunction() {
// Function logic here
}
// File where the function is called (index.php)
require_once 'functions.php';
// Call the function
myFunction();