<?php
$encoded = htmlentities("Hey I am a nefarious hacker! Look at my brackets! <script>HAHAHA</script>!");
$decoded = html_entity_decode($encoded);
echo "This is the text you want to send in your html source outputted from php. \n";
echo $encoded;
echo "\n\nThis is what it will look like on screen to the user.\n";
echo $decoded;
?>
This is the text you want to send in your html source outputted from php.
Hey I am a nefarious hacker! Look at my brackets! <script>HAHAHA</script>!
This is what it will look like on screen to the user.
Hey I am a nefarious hacker! Look at my brackets! <script>HAHAHA</script>!