How to check a valid contact number in PHP : <p>I want to check a valid contact number:-</p>

<ul>
<li>The number may or may not start with a + sign.</li>
<li>The number may contain <code>space</code> and hyphen (-) sign.</li>
<li>There should be no consecutive hyphen (-) sign.</li>
<li>There should be no other alphabets, special characters, etc.</li>
</ul>

<p>An example of valid contact number is + 91-8341239834 or +91 033 2664 3271</p>

<p>The number must not exceed 20 characters.</p>

<p>How can I do this?</p>

<p>here is my code till now:-</p>

<pre><code>preg_match('/^[0-9 .\-]+$/i', $number)
</code></pre>
