title: PHP preg_match for validating 10 digit mobile number
body: <p>I am trying to validate 10 digits mobile number using PHP function preg_match. The below code does not produce any output.</p>
  
  <p>Is it the regex wrong? or I am using it incorrectly.</p>
  
  <p>I was expecting <code>Hi True</code> in the output. if it matches or <code>Hi False</code> if it does not match.</p>
  
  <pre><code>&lt;?php
  $value = '9987199871';
  $mobileregex = "/^[1-9][0-9]{10}$/" ;  
  echo "Hi " . preg_match($mobileregex, $value) === 1; // @debug
  ?&gt;
  </code></pre>
  
  <p>regex taken from <a href="https://stackoverflow.com/a/7649835/4050261">https://stackoverflow.com/a/7649835/4050261</a></p>