PHP String nl2br() FunctionPHP string nl2br() is predefine function which is used to insert HTML line break before all newlines in a string. It returns string with <br \> or <br> before all newlines (\r\n, \n\r, \n and \r). Syntax:
Example 1Note: Generating valid HTML markup by using 'is_xhtml' parameter.Output: Your string is: Hello .\ n PHP. \ n Javatpoint By using 'nl2br()' function: Hello . PHP. Javatpoint Example 2Output: Your string is: Welcome \ r\ n We are learning PHP By using 'nl2br()' Function: Welcome We are learning PHP Example 3Output: By using 'nl2br()' Function:This is a PHP Tutorial Next TopicPHP String |
We provides tutorials and interview questions of all technology like java tutorial, android, java frameworks
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India