title: Create different range arrays from one big one
body: <p>I have an array that contains other arrays of US colleges broken down by the first letter of the alphabet. I've setup a test page so that you can see the array using print_r. That page is:</p>
  
  <p><a href="http://apps.richardmethod.com/Prehealth/Newpublic/test.php" rel="nofollow">http://apps.richardmethod.com/Prehealth/Newpublic/test.php</a></p>
  
  <p>In order to create that array, I used the following code:</p>
  
  <pre><code>    $alphabetized = array();
  
      foreach (range('A', 'Z') as $letter) {
  
              // create new array based on letter
              $alphabetized[$letter] = array();
  
              // loop through results and add to array
              foreach ( $users as $user ) {
                      $firstletter = substr($user-&gt;Schoolname, 0, 1);
  
                      if ( $letter == $firstletter ) {
                          array_unshift( $alphabetized[$letter], $user );
                      }
              }
      }
  </code></pre>
  
  <p>Now, I want to split the array so that a certain range of letters is in each array. For example,</p>
  
  <p>arrayABCEFGH - would contain the schools that begin with the letters A, B, C, D, E, F, G, and H. </p>
  
  <p>My question is, should I modify the code above so that I achieve this before I do one big array, OR should I do it after?</p>
  
  <p>And here is the big question . . if so, how? :-)</p>
  
  <p>Thanks in advance for any help. It's greatly appreciated.</p>