title: Clean & Safe string in PHP
body: <blockquote>
    <p><strong>Possible Duplicates:</strong><br>
    <a href="https://stackoverflow.com/questions/4223980/php-the-ultimate-clean-secure-function">PHP: the ultimate clean/secure function</a><br>
    <a href="https://stackoverflow.com/questions/129677/whats-the-best-method-for-sanitizing-user-input-with-php">What&#39;s the best method for sanitizing user input with PHP?</a>  </p>
  </blockquote>
  
  
  
  <p>What should I add to my function to be sure that every string that passes it will be 'server-friendly'? I use this small function to check inputs that contains names, e-mail addresses and ids.</p>
  
  <pre><code>   function checkInput($str) {
          $str = @strip_tags($str);
          $str = @stripslashes($str);
          $str = mysql_real_escape_string($str);
          return $str;
      }
  </code></pre>