strip
(n12br) 从数据库字段获取
我有一个文本区域值,其值源自字段(nl2br)
如何去掉“< br/>”,这样当我想编辑此字段时,“< br />”不会出现吗?
//$data["Content"] is the field that has <br/> tags inside
$content = $data["Content"];
//when want to edit, want to strip the <br/> tag
<td><textarea name="content" rows="10" style="width:300px;"><?=$content?></textarea></td>
我知道它应该使用 strip_tags() 函数,但不确定真正的方法,
任何帮助将不胜感激
i have a textarea value which its value derived from a field(nl2br)
how to strip off "< br/>", so that when i want to edit this field, the "< br />" will not be appeared?
//$data["Content"] is the field that has <br/> tags inside
$content = $data["Content"];
//when want to edit, want to strip the <br/> tag
<td><textarea name="content" rows="10" style="width:300px;"><?=$content?></textarea></td>
i know it should be using strip_tags() function but not sure the real way to do it
any help would be appreciated
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果你想使用 strip_tags,那么它就是:
If you wanna use strip_tags, then it would just be:
我将使用 str_replace 以下内容将替换
带有换行符,或者如果您不需要换行符
编辑
一个例子
i would be using str_replace the following will replace
<br/>
with newlineor if you don't want the newline
edit
an example