title: Validate Phone Number and Zip Code PHP
body: <p>I am trying to validate a phone number and require it to have 10 digits only no spaces or special characters allowed (example: 0123456789) and the same goes with zip code except 5 digits only (example: 01234).</p>
  
  <p>This is what I have for the phone number field so far.</p>
  
  <pre><code>$phone = stripslashes($_POST['phone']);
  
  if(!$phone || $phone == "Phone Number*")
  {
  $error .= "Please enter your phone number.&lt;br /&gt;";
  }
  </code></pre>
  
  <p>The next if statement should retrieve an error similar to "Please enter a valid phone number.  Example: "0123456789".</p>