Answer the question
In order to leave comments, you need to log in
How is it customary to store text in the database?
Tell us how it is customary to store text in the database, taking into account html tags? Is it accepted to use the raw html option, or are there some other options?
Answer the question
In order to leave comments, you need to log in
If this is about texts from some wysywig editor or comments, for example, then the general approach is this:
1. save as is, do not cut anything
2. filter before displaying on the page
Sometimes you can filter at the input, but there are chances to ruin user data, which is not good in general.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question