title: Extract first integer in a string with PHP
body: <p>Consider the following strings:</p>
  
  <pre><code>$strings = array(
      "8.-10. stage",
      "8. stage"
  );
  </code></pre>
  
  <p>I would like to extract the first integer of each string, so it would return</p>
  
  <pre><code>8
  8
  </code></pre>
  
  <p>I tried to filter out numbers with preg_replace but it returns all integers and I only want the first.</p>
  
  <pre><code>foreach($strings as $string)
  {
      echo preg_replace("/[^0-9]/", '',$string);
  }
  </code></pre>
  
  <p>Any suggestions? </p>