How to use nl2br in PHP
In this article I will explain how the nl2br() function can be used in PHP.
nl2br() function in PHP
The nl2br() function is used to add HTML line breaks (<br />) in front of all newline (\n) in a string.
- string string is required parameter. It determine check to string.
The following example show to how the nl2br() function can be used in PHP.
<h3 style="color: green;">nl2br() function example in PHP</h3>
echo nl2br("Welcome to.\nC-sharpcorner.");
You may also want to read these related articles here
Ask Your Question
Got a programming related question? You may want to post your question here