title: Php consolidate number (zip codes)
body: <p>I have a php array with zipcodes returned from a db query. Zip Codes are in German format so 5 digit long. </p>
  
  <p>Example:  </p>
  
  <pre><code>array ('90475', '90419', '90425', '90415', '90429', '90479', '90485');
  </code></pre>
  
  <p>I would like to consolidate the values to "ranges" with placeholder, like: </p>
  
  <pre><code> array ('90...', '904..', '9041.', '9042', '9047.');
   //90485 is left out because there is only 1 match. 
  </code></pre>
  
  <p>Edit / logic: 
  This is for an autosuggestion search. Trying to build a tree so users can search for entries that match any zipcode starting with 90 or 904, etc.. For the autocomplete to make sense I only want to provide the "9041." value if there is a minimum of two entries matching (90419 and 90415 in example). The zipcodes are always 5 digit long from 00000 - 99999. </p>
  
  <p>Highly appreciate any help.
  Thanks. </p>