You can use the PHP htmlspecialchars_decode() function to convert the special HTML entities such as &, <, > etc. back to the normal characters (i.e. &, <, >).
The htmlspecialchars_decode() function is opposite of the htmlspecialchars() function which converts special HTML characters into HTML entities. Let's check out an example:
<?php
$my_str = "I'll come & <b>"get you"</b>.";
// Decode &, <, > and "
echo htmlspecialchars_decode($my_str);
// Decode &, <, >, " and '
echo htmlspecialchars_decode($my_str, ENT_QUOTES);
// Decode &, < and >
echo htmlspecialchars_decode($my_str, ENT_NOQUOTES);
?>
Use the PHP
htmlspecialchars_decode()functionYou can use the PHP
htmlspecialchars_decode()function to convert the special HTML entities such as&,<,>etc. back to the normal characters (i.e.&,<,>).The
need an explanation for this answer? contact us directly to get an explanation for this answerhtmlspecialchars_decode()function is opposite of thehtmlspecialchars()function which converts special HTML characters into HTML entities. Let's check out an example: