天天看点

htmlentities — 将字符转换为 HTML 转义字符

htmlentities — 将字符转换为 HTML 转义字符

说明

htmlentities ( string

$string

[, int

$flags

= ENT_COMPAT | ENT_HTML401 [, string

$encoding

= ini_get("default_charset") [, bool

$double_encode

= true ]]] ) : string

本函数各方面都和 htmlspecialchars() 一样, 除了 htmlentities() 会转换所有具有 HTML 实体的字符。

如果要解码(反向操作),可以使用 html_entity_decode()。

参数

string

flags