I'm developing a website using PHP, MySQL and HTML.
In the database, one of the fields is a text that may contain HTML tags such as <b>
or <i>
, for example.
My problem is that in a specific part of the website (a search section), I wanna display only a 'summary'/substring of this field.
The problem is: when I get a part of this field to display in the page, tags that are not closed influence in the way the rest of the page is displayed.
Two things would solve this problem:
- Prevent these specific tags to be shown;
- After the field is displayed, I want to close all 'open tags'.
Note that option number one would be much better.