If you do not want to strip away those <h1> and other html tags ( [man]strip_tags[/man] )
you have these 2 functions to use:
[man]htmlspecialchars[/man]
[man]htmlentities[/man]
I use often htmlspecialchars() because mostly it is good enough.
It is the LITE version of htmlentities()
echo htmlspecialchars( $htmltext );
// or
echo htmlentities( $htmltext );