Question: Am currently working on an application that requires users to submit posts and comments which is displayed on the site. As we all know that user input can't be trusted so i used htmlspecialchars($string,ENT\_QUOTES) to process user's posts and comments. 

Now, i want some certain html tags ignored. such as `<b><br />` and a few more tags. How can i do it so that htmlspecialchars ignores some tags while it filters the others.

Answer: 
**solution a)**  

use strip\_tags insted of htmlspecialchars, and whitelist the needed tags.  

**better solution b)**  

Use bbcodes, and give aliases to the wanted tags, e.g: [b]bold[/b]
I would heavily recommend you use Zend\_Filter for filtering through user input. Specifically, see:
<http://framework.zend.com/manual/en/zend.filter.html#zend.filter.introduction.using>