title: Regex to validate Nigerian phone numbers using PHP's preg_match_all()
body: <p>I need a regex to match numbers in the following formats:</p>
  <pre><code>0000 000 0000
  01 000 0000
  +234 1 000 0000
  0000-000-0000
  00000000000
  234 000 000 0000
  234(000)000-0000
  234(000)000 0000
  +234(000)000 0000
  +234(000) 000 0000
  +234(000)000-0000
  2340000000000
  +2340000000000
  </code></pre>
  <p>What I already tried:
  <code>$pattern = '/^234[0-9]{11}/';</code></p>
  <p>But it only matches:
  <code>23400000000000</code></p>
  <p>Still a regex newbie. Expression should be fully compatible with PHP 8 PCRE and <code>preg_match_all()</code>. Would appreciate an explanation of the expression as well.</p>