$html_str = "Random Text™ First Second Third";
echo $str = html_entity_decode($html_str);
outputs: Random Text™ First Second Third
now how do I convert $str to $html_str?
$html_str = "Random Text™ First Second Third";
echo $str = html_entity_decode($html_str);
outputs: Random Text™ First Second Third
now how do I convert $str to $html_str?
Per the documentation: "html_entity_decode() is the opposite of htmlentities()..." http://php.net/manual/en/function.html-entity-decode.php
"htmlentities — Convert all applicable characters to HTML entities" http://php.net/manual/en/function.htmlentities.php
You want to use htmlentities
$html_str = htmlentities($str);