Good day,

I have an HTML code like
HTML Code:
<div><span>Some content inside</span></div>
in my DB and I want to echo it.
If I use, for instance,
HTML Code:
<?php $var = '<div><span>Some content inside</span></div>' //a content retrieved from the DB; 
echo htmlspecialchars($var);?>
it will echo '<div><span>Some content inside</span></div>' inside the wrapper div.

How should I use htmlspecialchars() when echoing similar HTML code?