【发布时间】:2017-08-09 19:52:54
【问题描述】:
我正在使用下面的代码。
<?
echo nl2br( 'The situation deteriorated into attacks on New York elite, followed by attacks on black New Yorkers and their property after fierce competition for a decade between
Irish immigrants and black people for work. Rioters burned the Colored Orphan Asylum to the ground.' , false ) ;
?>
我得到如下输出
The situation deteriorated into attacks on New York elite, followed by attacks on black New Yorkers and their property after fierce competition for a decade between <br>
Irish immigrants and black people for work. Rioters burned the Colored Orphan Asylum to the ground.
我想在没有<br> 的情况下获得输出,但此时我需要换行符(新行)。
【问题讨论】:
-
nl2br 的全部目的是添加
...如果您使用的是 nl2br,那么您有一个换行符。您可以使用“\n”在引号内插入换行符。
标签: php string laravel blade nl2br