I am currently in a project with a PHP frontend. We\'re pretty concerned about security, because we\'ll have quite a lot of users and are an attractive target for hackers. O
I can really recommend kses for HTML filtering. Actually that's what wordpress uses. Its free and open source.