title: how to prevent XSS attack with php function
body: <p>I'm using the <code>htmlspecialchars()</code> function to prevent XSS attacks but I'm not sure if that is the correct way to prevent such attacks:</p>
  
  <pre><code>htmlspecialchars($input_value);
  </code></pre>
  
  <p>If not, what is the best/simplest way to do it?</p>