This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 27 days ago.
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(3)
PHP 只解析
"
内的\r
和\n
,而不解析'
内的\r
和\n
。因此nl2br 在这里不适用
。
PHP parses
\r
and\n
only within"
, not within'
. Sonl2br
won't apply here.This ought to work.
该字符串包含嵌入的换行符,因此您最终会得到一些不需要的
。您可以:
或者,使用 < 更容易代码>
This string contains embedded newlines so you'll end up with a few unwanted
<br/>
s.You can:
Or, its much easier to use a
<pre>
tag:另一种方法是使用 HEREDOC。
这里文档的手动链接此处
An alternative is to use HEREDOC.
Manual link for heredoc here