title: PHP preg_replace only numbers
body: <p>I have a string and I want to get only number witch is between 5 and 7 charts.
  Here my problem:</p>
  
  <pre><code>$string = "Test 1 97779 test";
  if(strlen(preg_replace("/[^0-9]/", "", $string)) &gt;= 5 &amp;&amp; strlen(preg_replace("/[^0-9]/", "", $parts[7])) &lt;= 7) {
      $var = preg_replace("/[^\d-]+/", "", $string);
  } 
  </code></pre>
  
  <p>Result is: 19779, but I want only 97779.
  If someone have any suggestion I will be very glad. Thanks in advance.</p>