PHP - Cleaning Rich Text Area Input
<p>I am using a rich text box in my application and am looking at ways to clean the input before storing it in a database. Because I want to allow some HTML through I was thinking of using strip_tags with the allowed tags specified, something like this:</p>

<pre><code>public function cleanRichInput($text)
{
    return strip_tags(trim($text),"&lt;a&gt;&lt;div&gt;&lt;p&gt;&lt;strong&gt;");
}
</code></pre>

<p>That seems kind of cumbersome though, could anyone suggest a better way to handle input where you want some HTML to get through? Any advice would be appreciated, thanks! </p>
