How can PHP be used to include menus on a website?

To include menus on a website using PHP, you can create a separate PHP file for the menu code and then include it in your main website files using the `include` or `require` function. This allows you to easily update and maintain the menu across multiple pages without duplicating code.

// menu.php
<ul>
    <li><a href="index.php">Home</a></li>
    <li><a href="about.php">About</a></li>
    <li><a href="services.php">Services</a></li>
    <li><a href="contact.php">Contact</a></li>
</ul>
```

In your main website file:

```php
// index.php
<!DOCTYPE html>
<html>
<head>
    <title>My Website</title>
</head>
<body>
    <?php include 'menu.php'; ?>
    <h1>Welcome to my website</h1>
    <p>This is the homepage content.</p>
</body>
</html>