How can the use of include or require statements improve the code structure and prevent code duplication in PHP scripts?

Including or requiring external PHP files in your script allows you to separate reusable code into separate files, improving code structure and organization. This helps prevent code duplication by allowing you to include the same file in multiple scripts without rewriting the same code. This also makes it easier to maintain and update shared code across multiple scripts.

// Include the shared code file to prevent code duplication
include 'shared_code.php';

// Your PHP script code here