How to remove a link from content in php?

前端 未结 7 830
悲哀的现实
悲哀的现实 2020-12-24 09:12

How can i remove the link and remain with the text?

text text text. 
相关标签:
7条回答
  • 2020-12-24 10:12

    While strip_tags() is capable of basic string sanitization, it's not fool-proof. If the data you need to filter is coming in from a user, and especially if it will be displayed back to other users, you might want to look into a more comprehensive HTML sanitizer, like HTML Purifier. These types of libraries can save you from a lot of headache up the road.

    strip_tags() and various regex methods can't and won't stop a user who really wants to inject something.

    0 讨论(0)
提交回复
热议问题