PHP Manual

PHP funkce htmlentities()

2019-09-11T08:04:03.000Z

Obsah článku

Dostupnost ve verzích: PHP 4.0

Convert all applicable characters to HTML entities

Parametry

Parametr Datový typ Výchozí hodnota Poznámka
$string string není Zpracovávaný řetězec.
$quote_style int null, Like htmlspecialchars, the optional second quote_style parameter lets you define what will be done with 'single' and "double" quotes. It takes on one of three constants with the default being ENT_COMPAT: Available quote_style constants
Constant Name Description
ENT_COMPAT Will convert double-quotes and leave single-quotes alone.
ENT_QUOTES Will convert both double and single quotes.
ENT_NOQUOTES Will leave both double and single quotes unconverted.
$charset string null, Like htmlspecialchars, it takes an optional third argument charset which defines character set used in conversion. Presently, the ISO-8859-1 character set is used as the default.
$double_encode bool true When double_encode is turned off PHP will not encode existing html entities. The default is to convert everything.

string

the encoded string.

Další zdroje

Oficiální dokumentace funkce htmlentities

Jan Barášek   Více o autorovi

Autor článku pracuje jako seniorní vývojář a software architekt v Praze. Navrhuje a spravuje velké webové aplikace, které znáte a používáte. Od roku 2009 nabral bohaté zkušenosti, které tímto webem předává dál.

Rád vám pomůžu:

Související články

1.
105.

Potřebujete poradit s PHP?

Nabízím trénink vývojářů, konzultace, školení a analýzu návrhových vzorů. Osobně v Praze nebo online.

Napište mi, pokud si nevíte rady.

Lektor: Jan Barášek

V jiných jazycích

Status:
All systems normal.
2025