title: Phone number validation in php codeigniter
body: <p>I have used the call back function for phone no validation from <a href="https://stackoverflow.com/questions/1937376/codeigniter-form-validation-with-phone-numbers">here</a>.</p>
  
  <pre><code>function valid_phone_number_or_empty($value)
  {
      $value = trim($value);
  
      if ($value == '') {
              return TRUE;
      }
      else
      {
              if (preg_match('/^\(?[0-9]{3}\)?[-. ]?[0-9]{3}[-. ]?[0-9]{4}$/', $value))
              {
                      return preg_replace('/^\(?([0-9]{3})\)?[-. ]?([0-9]{3})[-. ]?([0-9]{4})$/', '($1) $2-$3', $value);
              }
              else
              {
                      return FALSE;
              }
      }
  }
  </code></pre>
  
  <p>But now the problem is it doesn't accept phone-no from european countries and other parts of world which are 11 to 13 digits. Can anyone provide me with any other validation for that's universal for all countries?</p>