PHP nl2br() Function

PHP nl_langinfo() Function
PHP number_format() Function

what is the syntax of the function in php?

NL2BR()
ParameterDescription
stringRequired. 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>
PHP nl2br() method

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);
PHP nl_langinfo() Function
PHP number_format() Function

Stay up-to-date about PHP!

We don’t spam!

en English
X
Scroll to Top