How can PHP be used to properly display multi-line database values in HTML?

When displaying multi-line database values in HTML using PHP, it is important to use the `nl2br()` function to convert newline characters to HTML line breaks. This ensures that the line breaks are properly displayed in the HTML output.

<?php
// Retrieve multi-line value from database
$multiLineValue = "This is a multi-line value.\nIt has multiple lines.";

// Display the multi-line value in HTML with proper line breaks
echo nl2br($multiLineValue);
?>