Which function in php validate if the string is valid html?

前端 未结 7 1894
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-03 16:30

Which function in php validate if the string is html? My target to take input from user and check if input html and not just string.

Example for not html string:

7条回答
  •  眼角桃花
    2020-12-03 16:52

    Are you trying to prevent users from posting html tags instead of strings? Cause if this is what you want to do you just need striptags()

    Wich will remove any html tags from the string.

提交回复
热议问题