Decoding HTML Entities
Login or Register to Bookmark this snippet
Convert all HTML entities to their applicable characters i.e. " => "
<?php
$orig = "I'll "walk" the <b>dog</b> now";
echo $a;
// I'll "walk" the <b>dog</b> now
echo $b;
// I'll "walk" the <b>dog</b> now
// For users prior to PHP 4.3.0 you may do this:
function unhtmlentities ($string) {
return strtr ($string,
$trans_tbl);
}
$c = unhtmlentities($a);
echo $c;
// I'll "walk" the <b>dog</b> now
?>
Added by JC on 14th November, 2007
There are no comments about this snippet.
You must be registered and logged in to post a comment.
Login here to post a comment