CKTIS / PHP
html_entity_decode()
Zastępuje obsługiwane encje nazwane i numeryczne znakami.
Wersja: PHP 8.4; repository runtime, production runtime not attested
Składnia
html_entity_decode(string $string, int $flags = ENT_QUOTES | ENT_SUBSTITUTE | ENT_HTML401, ?string $encoding = null): stringZastępuje obsługiwane encje nazwane i numeryczne znakami. Typ dokumentu wybiera zbiór encji, flagi cudzysłowów sterują ich dekodowaniem, a encoding określa bajty wyjścia. Jeden przebieg zamienia &lt; na <.
Sygnatura
html_entity_decode(string $string, int $flags = ENT_QUOTES | ENT_SUBSTITUTE | ENT_HTML401, ?string $encoding = null): string
Wynik przykładu
["<","'","""]
Przykłady
<?php
echo json_encode([html_entity_decode("&lt;",ENT_QUOTES|ENT_HTML5,"UTF-8"),html_entity_decode("'",ENT_QUOTES|ENT_HTML5,"UTF-8"),html_entity_decode(""",ENT_NOQUOTES|ENT_HTML5,"UTF-8")]);
Wynik
["<","'","""]