Add prefix to mobile number in php before sending it to database
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/11786411/please-help-me-validate-mobile-no-in-php-form">Please help me VALIDATE Mobile no in php form</a>  </p>
</blockquote>



<p>I got mobile number to validate but I am stuck at the prefix part.</p>

<pre><code>if(empty($_POST['mobileno'])) // phone number is not empty
{
$error[] = 'Please enter mobile number';
} else {
if(preg_match('/^\d{10}$/',$_POST['mobileno'])) // phone number is valid
{
  $mobile = $_POST['mobileno'];
  // your other code here
}
else // phone number is not valid
{
  $error[] = 'Phone number invalid !';
}
}
$prefix = 0;
$pmobile = $prefix . $mobile;
</code></pre>

<p>This is what I am trying to do for prefix. Is this right as I cant add the value 0 before the number.</p>
