I am storing the formatted text in the table which contains html tags (<br />, <strong>, etc).
If I use raw attribute in the div, it show perfectly but not in textarea. How I can display the formatted content in the textarea?

Recommended Answers

All 2 Replies

I think the below example will help.

$text = "How I can display \"content\" in the <b>textarea</b>? ";
echo $output = html_entity_decode($text);
Member Avatar

The textarea field only shows plain text. No formatting. You can change the font appearance of the whole text with CSS, but you can't show html formatting. However, you could use a WYSIWYG editor, e.g. CKEditor or a million other editors out there. Some of these hijack a textarea (or other elements, like divs) and use some javascript black magic to make it appear like a glorified textarea.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.