htmlspecialchars and htmlspecialchars_decode functions
<?php
$text = '<b id="test">\'Hi\'</b>';
$escaped = htmlspecialchars($text, ENT_QUOTES);
echo $escaped.PHP_EOL;
$text = htmlspecialchars_decode($escaped, ENT_QUOTES);
echo $text;
<?php
$text = '<b id="test">\'Hi\'</b>';
$escaped = htmlspecialchars($text, ENT_QUOTES);
echo $escaped.PHP_EOL;
$text = htmlspecialchars_decode($escaped, ENT_QUOTES);
echo $text;
Leave a Comment
Cancel reply