-2

I do not have HTML content in it, but regular string which has text like

 <some data>, <some text> 

it is being saved as some data&gt;

How do I save it exactly like this <some data>. I need to use this data somewhere else where it should match exactly like this, but its already encoded. I have already tried using entity_encoding: 'raw' and encoding: 'xml'. But they still end up encoding before saving. Thanks.

Michael Fromin
  • 13,131
  • 2
  • 20
  • 31
Aijaz
  • 680
  • 15
  • 42

1 Answers1

0

Those characters have to be encoded when part of HTML since the < and > have special meaning in HTML.

There are a variety of characters that have to be encoded per the specification and these are two of them.

Michael Fromin
  • 13,131
  • 2
  • 20
  • 31