PHP html_entity_decode() Function

The html_entity_decode() function is used to convert all HTML entities to their applicable characters. The html_entity_decode() function is the opposite of htmlentities(). You may also like PHP htmlspecialchars_decode() Function.

Example

<?php
$str = '&lt;a href=&quot;https://scriptsgurus.com&quot;&gt;scriptsgurus.com&lt;/a&gt;';
echo html_entity_decode($str);
?>

Output

<a href="http://scriptsgurus.com">Go to scriptsgurus.com</a> 

Leave a Reply

Your email address will not be published. Required fields are marked *