nl2br() function converts all newline (\n) characters to their HTML equivalent
. : nl2br « Utility Function « PHP






nl2br() function converts all newline (\n) characters to their HTML equivalent
.

 
Its syntax is: string nl2br (string string)

<?
    $text_recipe = "
    A
    B
    V";
    $html_recipe = nl2br ($text_recipe);
    print $html_recipe;
?>
  
  








Related examples in the same category

1.string nl2br ( string str ) inserts a HTML line break (
) before all new line characters
2.string nl2br ( string string ): changes any new line characters found in the data string into
.
3.Wrapping Text with wordwrap() and nl2br()
4.convert the newlines to