In PHP when submitting strings to the database should I take care of illegal characters using htmlspecialchars() or use a regular expression? In PHP when submitting strings to the database should I take care of illegal characters using htmlspecialchars() or use a regular expression? php php