PHP - htmlspecialchars_decode
Trieda
Metóda - htmlspecialchars_decode
(PHP 5 >= 5.1.0, PHP 7)
The opposite function of htmlspecialchars(). It converts
entities back to special characters.
Procedurálne
- function htmlspecialchars_decode (string $string, int $flags = ENT_COMPAT | ENT_HTML401) : string
Parametre
| Názov | Dátový typ | Predvolená hodnota | Popis | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| $string | string | The string to decode. | |||||||||||||||
| $flags | int | ENT_COMPAT | ENT_HTML401 | We can set so-called flags as the second parameter. These are constants
changing the behavior of the function. These constants can be joined by
|
Mávratovej hodnoty
Vracia: string
The decoded string.
Príklady
<?php
$s = '<a href="index.php?a=1&b=2">Link</a>';
echo htmlspecialchars_decode($s);
Súvisiace manuály
- function htmlspecialchars (string $string, int $flags = ENT_COMPAT | ENT_HTML401, string $encoding = ini_get("default_charset"), bool $double_encode = true) : string
