php htmlspecialchars
<p>what type of input should I be using htmlspecialchars with? or should I always use it to sanitize input data? or are there any better 'data sanitizing' functions? That is assuming that these values will be stored in a database</p>

<p>Example:</p>

<pre><code>$userdata = array(
 'username' =&gt; $_POST['username'],
 'email' =&gt; $_POST['email'],
 'password' =&gt; $_POST['password']
);

// register function defined in a class user accepts array as parameter
// register function hashes password before storage
$this-&gt;user-&gt;register($userdata);
</code></pre>

<p>should i apply htmlspecialchars to these data?</p>
