I want to display the output of PHP echo statement on the browser. The result is output of
htmlentities()
function of PHP.
$str = "A 'quote' is <b>bold</b>";
// Expected Outputs: A 'quote' is <b>bold</b>
echo "<textarea>".htmlentities($str)."</textarea>";
// Expected Outputs: A 'quote' is <b>bold</b>
echo "<textarea>".htmlentities($str, ENT_QUOTES)."</textarea>";
Apparently, it is giving me
A 'quote' is <b>bold</b>
inside my <textarea>
Please advise.