title: What does HTML Purifier do that secure PHP programming can't?
body: <p>I'm researching PHP security best practices and specifically the <a href="http://htmlpurifier.org/" rel="noreferrer">HTML Purifier</a> library.</p>
  
  <p>I like the idea of using a third-party library to help strengthen the security of my sites, but I'm confused about a few things...</p>
  
  <ol>
  <li><p>First, a general question... What does HTML Purifier do that practicing secure PHP programming can't?</p></li>
  <li><p>If I'm using HTML Purifier, does that mean I get to skip common security measures like using PHP functions to filter input and escape output?</p></li>
  <li><p>One of the response comments for <a href="https://stackoverflow.com/questions/1210042/html-purifier-what-to-purify">this question</a> seems to suggest that HTML Purifier is only needed for elements that allow HTML tags, such as WYSIWYG editors. Is this correct?</p></li>
  <li><p>Has anyone noticed a performance lag from using HTML Purifier? <a href="http://htmlpurifier.org/docs/enduser-slow.html" rel="noreferrer">This article</a> makes it seem like performance impact is worth considering.</p></li>
  <li><p>Are there any up-to-date tutorials on integrating HTML Purifier with a non-framework PHP application? Everything I've found is either <a href="http://ajaxian.com/archives/html-purifier-30" rel="noreferrer">old</a> or <a href="http://www.zendcasts.com/?s=html%20purifier" rel="noreferrer">framework-specific</a>.</p></li>
  </ol>
  
  <p>Just to confirm that I've done my homework before asking this...</p>
  
  <ul>
  <li><p><a href="https://stackoverflow.com/questions/5062536/does-i-need-to-use-html-purifier-if-im-stripping-tags-converting-them-to-html-e">This question</a> is essentially the same as mine, but the lone response seems to just list another best practice that the asker forgot to mention</p></li>
  <li><p><a href="https://stackoverflow.com/questions/5667857/html-filter-that-is-html5-compliant">This 'bountiful' question</a> is a terrific resource about HTML Purifier and HTML5, but assumes foundational knowledge</p></li>
  <li><p>This <a href="http://htmlpurifier.org/comparison" rel="noreferrer">comparison page</a> on HTML Purifier's site is more of a comparison to other filters</p></li>
  </ul>