Malasuerte94
Malasuerte94

Reputation: 1474

How to format plain text in php?

I extracted some text from an Excel file and stored it in a DB. After that, I fetch this text from the DB and display it on a page.

Below is how the problem looks like on the page:

enter image description here

And this is a screenshot of how it appears in the source code:

enter image description here

How can I format this paragraph to show in page correctly ?

Upvotes: 0

Views: 1095

Answers (2)

Max
Max

Reputation: 2643

Take a look at HTML Purifier. Pretty good at cleaning up dirty input. http://htmlpurifier.org/

Upvotes: 0

Bilal Usean
Bilal Usean

Reputation: 2474

Just try this

<div name="description" ....>
<pre>

.....
here your content
.....

</pre>
</div>

if not work let me know

Upvotes: 1

Related Questions