what is the syntax of the function in php?
NL2BR()
Parameter | Description |
---|---|
string | Required. Specifies the string to check |
xhtml | Optional. A boolean value that indicates whether or not to use XHTML compatible line breaks:TRUE- Default. Inserts <br />FALSE – Inserts <br> |
examples of the NL2BR() function
Example 1. In this example, we insert line breaks where newlines (\n) occur in the string.
<?php
echo nl2br("One line.\nAnother line.");
?>
Example 2. In this example, we want to see eagerly,
Note: Insert line breaks where newlines (\n) occur, using the xhtml parameter:
echo nl2br("One line.\nAnother line.",false);