Home > Backend Development > PHP Tutorial > PHP nl2br function converts newline characters into <br>_PHP tutorial

PHP nl2br function converts newline characters into <br>_PHP tutorial

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-07-21 15:45:16
Original
1174 people have browsed it

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.

www.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...
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Issues
php data acquisition?
From 1970-01-01 08:00:00
0
0
0
PHP extension intl
From 1970-01-01 08:00:00
0
0
0
How to learn php well
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template