----- without replacement"/> ----- without replacement">

Home >Backend Development >PHP Tutorial >unicode character PHP nl2br function converts newline characters into

unicode character PHP nl2br function converts newline characters into

WBOY
WBOYOriginal
2016-07-29 08:40:321237browse

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
instructions.

Copy the code The code is as follows:


$str='First line
Second line
Third line';
echo $str;// No replacement
echo("
-----------------
");
echo nl2br($str);// Display after replacement
?>


// Output
First line, second line and third line
-----------------
First line
Second line
Third line
nl2br
Convert newline characters to < ;br>.
PHP nl2br() syntax: string nl2br(string string);
Return value: string
Function type: data processing
PHP nl2br() content description
This function converts newline characters into HTML newline
instructions.

The above introduces the PHP nl2br function of unicode characters to convert newline characters into
, including the content of unicode characters. I hope it will be helpful to friends who are interested in PHP tutorials.

Statement:
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