CKTIS / PHP
html_entity_decode()
Sostituisce le entità HTML supportate, con nome o numeriche, con caratteri.
Versione: PHP 8.4; repository runtime, production runtime not attested
Sintassi
html_entity_decode(string $string, int $flags = ENT_QUOTES | ENT_SUBSTITUTE | ENT_HTML401, ?string $encoding = null): stringSostituisce le entità HTML supportate, con nome o numeriche, con caratteri. Il tipo di documento sceglie le entità, le opzioni delle virgolette ne regolano la decodifica ed encoding controlla i byte in uscita. Un passaggio trasforma &lt; in <.
Firma
html_entity_decode(string $string, int $flags = ENT_QUOTES | ENT_SUBSTITUTE | ENT_HTML401, ?string $encoding = null): string
Output dell’esempio
["<","'","""]
Esempi
<?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")]);
Risultato
["<","'","""]