You are here : phpstringnl2br

nl2br() - string

Returns string with 
or
inserted before all newlines ( , , and ).
Parameters :
  • string - The input string.
  • is_xhtml - Whether to use XHTML compatible line breaks or not.

  • Syntax

    string nl2br
        ( string $string
       [, bool $is_xhtml = true
      ] )


    Example

    <?phpecho nl2br("foo isn't\n bar");?>


    Output / Return Value


    Limitations


    Alternatives / See Also


    Reference