php - How to stop HTML text in textarea to be interpreted as code -


i have textarea users can edit. after edit save text in php variable $bio. when want display this:

    <?php      $bio = nl2br($bio);     echo $bio;     ?> 

but if user example types html command "strong" in text site output text bold. nothing want.

how can print/echo $bio on screen text , not html code?

thanks in advance!

replace echo $bio; echo htmlspecialchars($bio);

http://php.net/htmlspecialchars


Comments

Popular posts from this blog

c++ - OpenCV Error: Assertion failed <scn == 3 ::scn == 4> in unknown function, -

php - render data via PDO::FETCH_FUNC vs loop -

The canvas has been tainted by cross-origin data in chrome only -