----- without replacement"/> ----- without replacement">
Home >Backend Development >PHP Tutorial >unicode character PHP nl2br function converts newline characters into
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
?>
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.