The htmlspecialchars_decode Function
The htmlspecialchars_decode
function performs
the reverse operation of the htmlspecialchars
function.
Syntax
htmlspecialchars_decode(string $string, int $flags = ENT_COMPAT): string
Example
Let's convert a string with tags:
<?php
$str = '<b>text</b>';
$res = htmlspecialchars_decode($str);
echo $res;
?>
Code execution result:
'<b>text</b>'
See Also
-
the
html_entity_decode
function,
which performs a similar operation -
the
htmlspecialchars
function,
which performs the reverse operation