Funzione htmlspecialchars_decode
La funzione htmlspecialchars_decode esegue
un'operazione inversa alla funzione htmlspecialchars.
Sintassi
htmlspecialchars_decode(string $string, int $flags = ENT_COMPAT): string
Esempio
Convertiamo una stringa con dei tag:
<?php
$str = '<b>text</b>';
$res = htmlspecialchars_decode($str);
echo $res;
?>
Risultato dell'esecuzione del codice:
'<b>text</b>'
Vedi anche
-
la funzione
html_entity_decode,
che esegue un'operazione simile -
la funzione
htmlspecialchars,
che esegue l'operazione inversa