title: How Do I use htmlspecialchars but allow only specific HTML code to pass through without getting converted?
body: <p>Here is the line of code I have which works great:</p>
  
  <pre><code>$content = htmlspecialchars($_POST['content'], ENT_QUOTES);
  </code></pre>
  
  <p>But what I would like to do is allow only certain types of HTML code to pass through without getting converted. Here is the list of HTML code that I would like to have pass:</p>
  
  <pre><code>&lt;pre&gt; &lt;/pre&gt;
  &lt;b&gt; &lt;/b&gt;
  &lt;em&gt; &lt;/em&gt;
  &lt;u&gt; &lt;/u&gt;
  &lt;ul&gt; &lt;/ul&gt;
  &lt;li&gt; &lt;/li&gt;
  &lt;ol&gt; &lt;/ol&gt;
  </code></pre>
  
  <p>And as I go, I would like to also be able to add in more HTML later as I think of it. Could someone help me modify the code above so that the specified list of HTML codes above can pass through without getting converted?</p>