Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
伙计们,我只想问是否有可能:例如$currenttext = "someexamplepls"; ,如果您想显示或打印它,只需使用print "$currenttext";,那么准备好的输出看起来像这样someexamplepls。我的问题是我是否想这样打印:
$currenttext = "someexamplepls";
print "$currenttext";
someexamplepls
somee xampl epls
在每 5 个字符中有一个自动换行符我该怎么办?
使用wordwrap():
wordwrap()
echo wordwrap($str, 5, "\n", true);
如果您希望 HTML 换行符使用<br>而不是\n.
<br>
\n