一个PHP文件里:
<textarea>
aa /r /n bb
</textarea>
意思就是想在<textarea>里换行,可是始终就是换不了, /n还是/n这样的字符
但是如果加个 htmlentities,就能换行了。
<textarea>
aa /r /n <?php echo htmlentities("/n")?> bb
</textarea>
htmlentities() 函数把字符转换为 HTML 实体。
一个PHP文件里:
<textarea>
aa /r /n bb
</textarea>
意思就是想在<textarea>里换行,可是始终就是换不了, /n还是/n这样的字符
但是如果加个 htmlentities,就能换行了。
<textarea>
aa /r /n <?php echo htmlentities("/n")?> bb
</textarea>
htmlentities() 函数把字符转换为 HTML 实体。