3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $encoded = htmlentities("Hey I am a nefarious hacker! Look at my brackets! <script>HAHAHA</script>!"); $decoded = html_entity_decode($encoded); echo "htmlentities makes the text from the comment box safe to put in HTML source code. \n"; echo $encoded; echo "\n\nLike the user's web browser will do automatically, html_entity_decode makes it look normal again.\n"; echo $decoded; ?>
Output for 4.3.0 - 7.1.0
htmlentities makes the text from the comment box safe to put in HTML source code. Hey I am a nefarious hacker! Look at my brackets! &lt;script&gt;HAHAHA&lt;/script&gt;! Like the user's web browser will do automatically, html_entity_decode makes it look normal again. Hey I am a nefarious hacker! Look at my brackets! <script>HAHAHA</script>!