PHP function htmlentities()
Availability in PHP 4.0
Convert all applicable characters to HTML entities
Parameters
| Parameter | Data type | Default value | Note | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
$string |
string |
not | String being processed. | ||||||||
$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:
|
||||||||
$charset |
string |
null, | Like htmlspecialchars, it takes an optional third argument charset which defines the 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. |
Return values
string
the encoded string.