I have a column in SQL ‘Text’ datatype and inside I have content within html tag, eg
somecontent:
- one
- two
Cheers folks
Nick
Advertisement
Answer
MySQL wouldn’t strip tags from text – it couldn’t care less what the text is. PHP also wouldn’t strip tags, unless somewhere in your code you do a strip_tags()
or equivalent.
If you want to force the browser to display the tags in the retrieved data, you can run the string through [htmlspecialchars()][1]
, which converts html metacharacters (<
, >
, "
, &
, etc…) to their character entity equivalents (<
, >
, etc…).
Or you can force the entire page to be rendered as plain text by doing
header('Content-type: text/plain');