title: How can I return the first set of numbers from PHP string? Regex or Preg_Replace?
body: <p>I don't know what to use as doing str_replace and other methods will cause code bloating.</p>
  
  <p>I want to get the first few digits from this string - everything after should be ignored. So get the first set of numbers and after the space or anything else - remove it.</p>
  
  <pre><code>$size = $data;
  
  The $data tab is filled with ONE of the following:
  
  $data="18 Bespoke(Size:S Colour:106)"; 
  $data="148 Bespoke(Size:M Colour:2334)"; 
  $data="Enter Colour Here";
  $data="(sometimes it is empty)";
  </code></pre>
  
  <p>It should return</p>
  
  <p><code>18</code> or <code>148</code> - the first set of numbers and remove the <code>Bespoke(Size:M Colour:2334)</code> includes removing the spaces. Was going to do a <code>str_replace</code> but would take forever. It should only return the first numbers, so if <code>$data="457 Bespoke(Size:MS Colour:3734)"</code> it should echo out <code>457</code></p>