php中怎么转义html标签

来自:互联网
时间:2021-02-24
阅读:

php中转义html标签

1、htmlentities()函数转义html

htmlentities() 函数把字符转换为 HTML 实体。

提示:要把 HTML 实体转换回字符,请使用 html_entity_decode() 函数。

提示:请使用 get_html_translation_table() 函数来返回 htmlentities() 使用的翻译表。

语法

htmlentities(string,flags,character-set,double_encode)

php中怎么转义html标签

php中怎么转义html标签

2、html_entity_decode()函数反转义html

html_entity_decode() 函数把 HTML 实体转换为字符。

html_entity_decode() 函数是 htmlentities() 函数的反函数。

语法

html_entity_decode(string,flags,character-set)

php中怎么转义html标签

php中怎么转义html标签

返回顶部
顶部