How to strip tags in a safer way than using strip_tags function?

后端 未结 3 1600
耶瑟儿~
耶瑟儿~ 2021-01-18 05:48

I\'m having some problems using strip_tags PHP function when the string contains \'less than\' and \'greater than\' signs. For example:

If I do:

stri         


        
3条回答
  •  说谎
    说谎 (楼主)
    2021-01-18 06:53

    Instead of strip_tags(), just use htmlspecialchars() instead.

    http://php.net/manual/en/function.htmlspecialchars.php

提交回复
热议问题