title: PHP - Add leading zeros to number but keep maximum length
body: <p>I have an Auto-Increment field in a database.  </p>
  
  <p>I want these numbers to be prepended by zeros, to a maximum length of seven.</p>
  
  <p>Example:</p>
  
  <blockquote>
    <p>Original number: 1  Desired result: 0000001</p>
  </blockquote>
  
  <p>or </p>
  
  <blockquote>
    <p>Original number 768 Desired result 0000768</p>
  </blockquote>
  
  <p>How would I achieve this in PHP?</p>