title: How to match the prefix of a number in php using preg_match
body: <p>I am trying to check the prefix of a number. The following is my code;</p>
  
  <pre><code>   if (preg_match('[^\070|071|072|25470|25471|25472]', $phoneno)) {
                  $countryCode="254";
                  $newNumber = preg_replace('/^0?/', $countryCode, $phoneno);
                    } else {
                  $response = array("status_code"=&gt;"1234","message"=&gt;"Invalid Phone number");
                  $this-&gt;response(json_encode($response),200,$this-&gt;callback);
          }
  </code></pre>
  
  <p>Every time a request is made the response I get is "Invalid Phone number".</p>