How can I allow HTML in a whitelist with PHP

后端 未结 4 2154
遇见更好的自我
遇见更好的自我 2020-12-11 12:02

I know there is a lot of discussion for years on best methods of filtering data with PHP but I would like to go the whitelist approach in my current project.

I only

4条回答
  •  余生分开走
    2020-12-11 12:17

    The simplest solution would be strip_tags(), which accepts a second argument containing allowable tags:

    strip_tags($string, "
      1. ");

提交回复
热议问题