In PHP, what best practices can be followed to ensure proper formatting and handling of line breaks in message content for APIs like Threema?

When sending message content through APIs like Threema, it is important to properly handle line breaks to ensure the message is displayed correctly to the recipient. To achieve this, it is best practice to use PHP's `nl2br()` function to convert newline characters to HTML line breaks before sending the message content.

// Sample message content with line breaks
$message = "Hello, this is a message with
line breaks.";

// Convert newline characters to HTML line breaks
$message = nl2br($message);

// Send the formatted message content through the API
// Code to send message content through Threema API