title: CodeIgniter , Filter, Trim, Stripslashes, Strip_tags and sanatize and replace bad chars in 1 function?
body: <p>I just started using codeigniter, and i would like to perform input formatting using 1 function.</p>
  
  <p>Code i would like implemeneted on my input:</p>
  
  <pre><code>function sanitize ($string)
  {
      $string = filter_var($string, FILTER_SANITIZE_STRING);
      $string = trim($string);
      $string = stripslashes($string);
      $string = strip_tags($string);
  
      return $string;
  }
  </code></pre>
  
  <p><strong>My Question is:</strong></p>
  
  <p>Does codeigniter perform these actions by default when i use the input class?
  Or do i need to create a custom function to filter my input.</p>
  
  <p><strong>My Goal is:</strong></p>
  
  <p>Clean and secure user input on forms and trim spaces in it.</p>