What are some best practices for handling multiple submit buttons in a PHP form?

When handling multiple submit buttons in a PHP form, it's important to differentiate between the buttons and perform different actions based on which button is clicked. One common approach is to use the "name" attribute of the submit buttons to identify them and then check which button was clicked using PHP. This can be achieved by checking the value of the submit button in the form submission handler.

// HTML form with multiple submit buttons
<form method="post" action="handle_form.php">
    <button type="submit" name="action" value="save">Save</button>
    <button type="submit" name="action" value="delete">Delete</button>
</form>
```

```php
// handle_form.php
if ($_SERVER["REQUEST_METHOD"] == "POST") {
    if (isset($_POST['action']) && $_POST['action'] == 'save') {
        // Handle save action
    } elseif (isset($_POST['action']) && $_POST['action'] == 'delete') {
        // Handle delete action
    }
}