<?php
$text = "The quick brown fox jumped over the lazy dog.";
$newtext = wordwrap($text, 20, "<br />\n");
echo $newtext;
?>
我找到了这段代码但如何在框中执行此操作?
答案 0 :(得分:0)
尝试将此代码用于20个字符
<?php
$text = "The quick brown fox jumped over the lazy dog.";
$newtext = wordwrap("<p>".$text."</p>", 28, "</p><br><p>");
echo $newtext;
?>
输出:
<p>The quick brown fox</p><br><p>jumped over the lazy</p><br><p>dog.</p>