How can HTML code be converted back to its original form using PHP?

When HTML code is passed through PHP functions like htmlentities(), it is encoded to prevent XSS attacks. To convert it back to its original form, you can use the html_entity_decode() function in PHP. This function will decode HTML entities back to their original characters.

<?php
$html_code = "<h1>Hello, World!</h1>";
$decoded_html = html_entity_decode($html_code);
echo $decoded_html;
?>