title: What is difference between php strip_tags and filter_var function?
body: <p>They both seems to stripe out html,javascript tags. So when to use which?
  I have tried both like</p>
  
  <pre><code>&lt;?php
  
  $user_input = "&lt;script&gt;alert('Your site sucks!');&lt;/script&gt;";
  
  echo strip_tags($user_input);
  
  ?&gt;
  </code></pre>
  
  <p>And</p>
  
  <pre><code>&lt;?php
  
  $user_input = "&lt;script&gt;alert('Your site sucks!');&lt;/script&gt;";
  
  echo filter_var($user_input, FILTER_SANITIZE_STRIPPED);
  
  ?&gt;
  </code></pre>