|
|
PHP html_entity_decode Function
|
Tutorials » Php »
|
Topic |
What is html_entity_decode Function?
|
|
Explanation |
|
In PHP, this function is used to convert all HTML entities to their applicable characters.
Syntax:
html_entity_decode(string,quotestyle,character-set)
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:
<?php
$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.
NOTE:
Please use "View Source" to know the exact output of the function>
|
|
A Note |
Learn PHP programming language tutorial with simple and neat example. Hope you enjoy this free tutorial.
Do give us your valuable feedback and suggestions on this online tutorial. This is a Copyright Content.
|
|
|
|