How can PHP developers differentiate between message IDs for a "Freigeben / Löschen" function?

To differentiate between message IDs for a "Freigeben / Löschen" function, PHP developers can add a parameter in the function that specifies the action to be taken (e.g., "Freigeben" or "Löschen"). This parameter can then be used to determine the appropriate action to perform on the message ID.

function handleAction($messageId, $action) {
    if($action == "Freigeben") {
        // Code to release the message
    } elseif($action == "Löschen") {
        // Code to delete the message
    } else {
        // Handle invalid action
    }
}

// Example usage
$messageId = 123;
$action = "Löschen";
handleAction($messageId, $action);