Funkcija html_entity_decode
Funkcija html_entity_decode konvertuje
HTML entitete u odgovarajuće simbole.
Pogledajte primere za bolje razumevanje.
Sintaksa
html_entity_decode(string $string, int $flags = ENT_COMPAT, ?string $encoding = null): string
Primer
Hajde da konvertujemo string sa tagovima:
<?php
$str = '<b>text</b>';
$res = html_entity_decode($str);
echo $res;
?>
Rezultat izvršavanja koda:
'<b>text</b>'
Primer
Hajde da konvertujemo string sa ampersandom:
<?php
$str = 'test: &';
$res = html_entity_decode($str);
echo $res;
?>
Rezultat izvršavanja koda:
'test: &'
Pogledajte takođe
-
funkciju
htmlentities,
koja izvršava obrnutu operaciju -
funkciju
htmlspecialchars,
koja izvršava sličnu obrnutu operaciju