The nl2br() function can convert the newline characters in the string into HTML newline symbols
Copy the code The code is as follows:
$str = "It has been raining in the past few days. I am very sad
. I can’t hit the ball and my shoes are soaked.";
echo $str;
echo "
";
echo nl2br($str);
?>
Output result:
Copy code The code is as follows:
It has been raining in the past few days. I am so sad. I can’t hit the ball and my shoes are soaked.
It has been raining in the past few days. I am very sad. I cannot hit the ball and my shoes are soaked.
Attachment: Discuss in depth what is the difference between "
" and "rn"??
http://www.bkjia.com/PHPjc/327303.htmlwww.bkjia.comtruehttp: //www.bkjia.com/PHPjc/327303.htmlTechArticlenl2br() function can convert the newline characters in the string into HTML newline symbols. Copy the code as follows: ? php $str = "It has been raining in the past few days. I am so sad. I can’t hit the ball and my shoes are wet...