Convert some HTML entities to characters in PHP
Description
The following code shows how to convert some HTML entities to characters.
Example
//from www .ja v a2 s .c o m
<?php
$str = "XML & 'HTML'";
echo html_entity_decode($str, ENT_COMPAT); // Will only convert double quotes
echo "<br>";
echo html_entity_decode($str, ENT_QUOTES); // Converts double and single quotes
echo "<br>";
echo html_entity_decode($str, ENT_NOQUOTES); // Does not convert any quotes
?>
The code above generates the following result.