Mr. Sam
Mr. Sam

Reputation: 790

Export excel file with php keeping html tags

Hy guys.

My client wanted and option to import / export an excel file full of products. In this excel file i have a cell which contains the product description. The import works just fine.

When he imports the excel the description cell contains html tags to: so an example would be:

<h1>Some title about the product</h1>
<p>Some text about the product <img src="absolute-path"/> also maybe a link</p>

My problem is when i want to export this excel with this description field, the html tags are being rendered, and i don't want that.

Is there a way to escape the rendering and keep the the tags also, like the code above?

Upvotes: 0

Views: 2796

Answers (1)

Mr. Sam
Mr. Sam

Reputation: 790

htmlspecialchars() solved my problem

Upvotes: 1

Related Questions