What are the benefits of using include statements in PHP for reusing code, and how can they be optimized for better performance?

Using include statements in PHP allows you to reuse code across multiple pages, reducing redundancy and making maintenance easier. To optimize performance when using include statements, you can use require_once instead of include to ensure that the file is only included once, reducing unnecessary file reads and improving performance.

// Example of using require_once for better performance
require_once 'header.php';
// Your page content here
require_once 'footer.php';