Convert newline characters to
.
Syntax: string nl2br(string string);
Return value: String
Function type: Data processing
Content description
This function converts newline characters into HTML newline
instruction.
Copy code The code is as follows:
$str=' First line
No. Line 2
Line 3';
echo $str;// No replacement
echo("
-----------------< ;br>");
echo nl2br($str);// After replacement, display
?>
// Output
first line, second line, third line Line
-----------------
First line
Second line
Third line
nl2br
Convert newline characters into
.
PHP nl2br() syntax: string nl2br(string string);
Return value: string
Function type: data processing
PHP nl2br() content description
This function converts newline characters The
directive for HTML line breaks.
http://www.bkjia.com/PHPjc/320366.htmlwww.bkjia.comtruehttp: //www.bkjia.com/PHPjc/320366.htmlTechArticleConvert newline characters to br. Syntax: string nl2br(string string); Return value: String Function type: Data processing Content description This function converts newline characters into HTML newline br...