Codeigniter form validation set rules to accept numbers and dashes
<p>I tried setting a rule in codeigniter form validation to accept input such as numbers and dashes. I read the Codeigniter documentation but it doesn't support such thing. Is there any way to write a custom function? Any help would be much appreciated.</p>

<pre><code>$this-&gt;form_validation-&gt;set_rules('phone', 'Contact No.', 'numeric');
</code></pre>