What are the best practices for handling form submissions with multiple submit buttons in PHP?

When dealing with form submissions that have multiple submit buttons, it's important to differentiate between which button was clicked to determine the appropriate action to take. This can be achieved by giving each submit button a unique name and value, and then checking which button was clicked in the PHP code to execute the corresponding logic.

if(isset($_POST['submit_button1'])){
    // Code to handle submission for button 1
} elseif(isset($_POST['submit_button2'])){
    // Code to handle submission for button 2
} else {
    // Default action if no button was clicked
}