title: How to find the first 4 digit number in a string?
body: <p>Let's say I have a string:</p>
  <pre><code> $string = &quot;12, 123, 1234, 12345, 56, 567, 5678&quot;;
  </code></pre>
  <p>And I want to return the <strong>first</strong> <em>4 digit</em> number in the string only.</p>
  <p>I have a few thoughts on how I could do this, for example using:</p>
  <pre><code>explode(&quot; &quot;, $string)
  </code></pre>
  <p>And then perhaps</p>
  <pre><code>substr_count()
  </code></pre>
  <p>But I am not really sure how to return the first 4 digit number only, I have seen some examples of regex being used, but I don't think that would apply here.</p>