title: PHP Security (strip_tags, htmlentities)
body: <p>I'm working in a personal project and besides using prepared statements, I would like to use every input as threat. For that I made a simple function.</p>
  
  <pre><code>function clean($input){
  if (is_array($input)){
      foreach ($input as $key =&gt; $val){
          $output[$key] = clean($val);
      }
  }else{
      $output = (string) $input;
      if (get_magic_quotes_gpc()){
          $output = stripslashes($output);
      }
      $output = htmlentities($output, ENT_QUOTES, 'UTF-8');
  
  }
  return $output;
  }
  </code></pre>
  
  <p>Is this enought or should I use to the following code?</p>
  
  <pre><code>        $output = mysqli_real_escape_string($base, $input);
          $output = strip_tags($output);
  </code></pre>
  
  <p>Sorry this could be a silly question but I would like to avoid any problem with me code :)
  Thanks for your help</p>