In the provided PHP code snippet, where should the nl2br() function be applied to ensure that user-entered line breaks are displayed correctly in the output?

When user-entered text contains line breaks, they are represented as "\n" characters in the input. To display these line breaks correctly in the output, the nl2br() function should be applied to the user input before displaying it. This function converts newlines to HTML line breaks (<br> tags), ensuring that the line breaks are rendered properly in the browser.

$userInput = $_POST[&#039;user_input&#039;]; // Assuming user input is retrieved from a form POST request
$processedInput = nl2br($userInput);
echo $processedInput;