Funksioni html_entity_decode
Funksioni html_entity_decode konverton
entitetet HTML në simbolet përkatëse.
Shikoni shembujt për një kuptim më të mirë.
Sintaksa
html_entity_decode(string $string, int $flags = ENT_COMPAT, ?string $encoding = null): string
Shembull
Le të konvertojmë një varg me etiketa:
<?php
$str = '<b>text</b>';
$res = html_entity_decode($str);
echo $res;
?>
Rezultati i ekzekutimit të kodit:
'<b>text</b>'
Shembull
Le të konvertojmë një varg me ampersand:
<?php
$str = 'test: &';
$res = html_entity_decode($str);
echo $res;
?>
Rezultati i ekzekutimit të kodit:
'test: &'
Shihni gjithashtu
-
funksionin
htmlentities,
i cili kryen operacionin e kundërt -
funksionin
htmlspecialchars,
i cili kryen një operacion të kundërt të ngjashëm