Search code examples
phptextareastrip-tagsnl2br

strip <br>(n12br) get from database field


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


Solution

  • If you wanna use strip_tags, then it would just be:

    $content = strip_tags($data["Content"]);