htmlentities() vs. htmlspecialchars()

前端 未结 12 2258
走了就别回头了
走了就别回头了 2020-11-22 02:50

What are the differences between htmlspecialchars() and htmlentities(). When should I use one or the other?

12条回答
  •  庸人自扰
    2020-11-22 03:17

    I just found out about the get_html_translation_table function. You pass it HTML_ENTITIES or HTML_SPECIALCHARS and it returns an array with the characters that will be encoded and how they will be encoded.

提交回复
热议问题