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().

Example

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

Output

<a href="https://www.w3schools.com">Go to w3schools.com</a> 

Leave a Reply

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