How can functions and methods in PHP scripts be organized and separated into different files for better code reusability?

To organize functions and methods in PHP scripts and improve code reusability, you can separate them into different files and then include these files where needed in your main script. This approach helps in keeping the codebase clean, modular, and easier to maintain.

// functions.php
function greet() {
    echo "Hello, World!";
}

// main.php
include 'functions.php';
greet();