title: In PHP when submitting strings to the database should I take care of illegal characters using htmlspecialchars() or use a regular expression?
body: <p>I am working on a form with the possiblity for the user to use illegal/special characters in the string that is to be submitted to the database. I want to escape/negate these characters in the string and have been using <a href="http://php.net/manual/en/function.htmlspecialchars.php" rel="noreferrer">htmlspecialchars()</a>. However, is there is a better/faster method?</p>