Reputation: 129
I was looking for a way to prevent display html tags in comments
for example if user put a html tags like <br>
or <hr>
dont display a horizontal line or line break just show as it was(print out put: <br> or <hr>
)
Upvotes: 1
Views: 112
Reputation: 72681
You should use htmlspecialchars()
to prevent this. This will also prevent XSS attacks.
http://codepad.viper-7.com/w5U8qs
Upvotes: 4