title: PHP Regex - Value of 1 or more integers
body: <p>Hey I'm trying to perform input validation in PHP to ensure that the stock values that are typed in are at least 1 positive integer and from 0-9. Should not contain any special characters.</p>
  
  <p>For example, any of the following values should be valid:</p>
  
  <pre><code>7
  0
  32
  47534
  </code></pre>
  
  <p>The following SHOULD NOT be valid:</p>
  
  <pre><code>asdf
  35/gdf
  ../34.
  
  etc..
  </code></pre>
  
  <p>I'm using the following if statement to check for the positive integer value of "$original_stock".</p>
  
  <pre><code>if (preg_match("/^[0-9]$/", $original_stock)) 
  {
      $error .="Original stock must be numerical.";
  }
  </code></pre>
  
  <p>Additionally, I have a price field which should be validated as either an int or a double.</p>
  
  <p>If there's an easier alternative to using regex, that's okay too!</p>
  
  <p>Thanks in advance :)</p>