Funkcija html_entity_decode
Funkcija html_entity_decode pretvori
HTML entitete v ustrezne simbole.
Oglejte si primere za boljše razumevanje.
Sintaksa
html_entity_decode(string $string, int $flags = ENT_COMPAT, ?string $encoding = null): string
Primer
Pretvorimo niz z oznakami:
<?php
$str = '<b>text</b>';
$res = html_entity_decode($str);
echo $res;
?>
Rezultat izvajanja kode:
'<b>text</b>'
Primer
Pretvorimo niz z ampersandom:
<?php
$str = 'test: &';
$res = html_entity_decode($str);
echo $res;
?>
Rezultat izvajanja kode:
'test: &'
Glejte tudi
-
funkcijo
htmlentities,
ki izvede obratno operacijo -
funkcijo
htmlspecialchars,
ki izvede podobno obratno operacijo