CKTIS / PHP
html_entity_decode()
Podržane imenovane i brojčane entitete HTML zamjenjuje znakovima.
Verzija: PHP 8.4; repository runtime, production runtime not attested
Sintaksa
html_entity_decode(string $string, int $flags = ENT_QUOTES | ENT_SUBSTITUTE | ENT_HTML401, ?string $encoding = null): stringPodržane imenovane i brojčane entitete HTML zamjenjuje znakovima. Vrsta dokumenta odabire skup entiteta, zastavice za navodnike određuju njihovo dekodiranje, a encoding izlazne bajtove. Jedan prolaz mijenja &lt; u <.
Potpis
html_entity_decode(string $string, int $flags = ENT_QUOTES | ENT_SUBSTITUTE | ENT_HTML401, ?string $encoding = null): string
Ispis primjera
["<","'","""]
Primjeri
<?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")]);
Rezultat
["<","'","""]