Where can I use / htmlspecialchars() ?
- When do we add info to the database?
- When we withdraw from the database?
For example, a user entered <div>some text</div> , should I process it by htmlspecialchars() and only then add it to the database?
In what form should I store information in the database?
And one more question - if I have a text in the database, but it is in the following format
<div><span>something</span><a href="example.com">example.com</a></div> If you use htmlspecialchars() on this text, it is displayed as in the html editor (including tags). How can htmlspecialchars() be used in this case?