我有一个文本区域值,其值源自字段(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() 函数,但不确定真正的方法
如有任何帮助,我们将不胜感激
最佳答案
如果你想使用 strip_tags,那么它就是:
$content = strip_tags($data["Content"]);
关于php - strip <br>(n12br) 从数据库字段获取,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6167644/