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