How can the require_once function be used effectively to include PHP files without executing them immediately?

When using the `require_once` function in PHP to include files, the included files are executed immediately. To include PHP files without executing them immediately, you can wrap the code inside the included file in a function and then call that function when needed.

// File to be included (included_file.php)
function myFunction() {
    // Your code here
}

// Main file
require_once 'included_file.php';

// Call the function when needed
myFunction();