How can PHP developers handle text line breaks after using openssl_decrypt?

When using openssl_decrypt in PHP to decrypt text, line breaks may be added to the decrypted text, causing formatting issues. To handle this, developers can use the trim() function to remove any leading or trailing whitespace, including line breaks, from the decrypted text.

// Decrypt the text
$decryptedText = openssl_decrypt($encryptedText, $method, $key, 0, $iv);

// Remove any leading or trailing whitespace, including line breaks
$decryptedText = trim($decryptedText);