I want to allow tags like <b>, <h1>, <h2> but still disabling HTML in posts.
How can I do that? can I do it with htmlspecialchars?
Thanks for your help , The site and the users are really helpful :).
you can use strip_tags http://fr.php.net/manual/en/function.strip-tags.php the second arguments allows some tags.
Use strip_tags().
http://php.net/manual/en/function.strip-tags.php
$stripped = strip_tags($text, "<b><h1><h2>");
Caveat emptor. There might be some security implications there.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With