PHP html_entity_decode Function

What is html_entity_decode Function?


In PHP, this function is used to convert all HTML entities to their applicable characters.



In the above syntax "string" specifies the text to decode, "quotestyle" specifies how to decode single and double quotes,"characterset" specifies the character set to be used.

Example :

$str = "Hiox & 'India'";
echo html_entity_decode($str);
echo "<br />";
echo html_entity_decode($str, ENT_QUOTES);
echo "<br />";
echo html_entity_decode($str, ENT_NOQUOTES);
Result :

Hiox & 'India'
Hiox & 'India'
Hiox & 'India'

In the above example the different quotestyles "ENT_QUOTES",which decodes both single and double quotes, "ENT_NOQUOTES" which doesnt decode any quotes are used.


Please use "View Source" to know the exact output of the function

PHP Topics

Ask Questions

Ask Question