title: How to print username for each alphabet letter
body: <p>I have script where I try to print names following its alphabetical letter:</p>
  <pre><code>$alphabets = 'abcdefghijklmnopqrstuvwxyz';
  $usersResult = getUsersEmail();
  echo &quot;&lt;div class='m0'&gt;&quot;;
  echo &quot;&lt;div id=woohoo class=hey_im_here&gt;&quot;;
  
  echo '&lt;input class=&quot;search&quot; placeholder=&quot;Enter a name&quot;&gt;';
  echo &quot;&lt;br&gt;&lt;br&gt;&quot;;
  $c=26; //or count(alphabets)
  $count = count($usersResult);
  for ($ii=0;$ii&lt;$c;$ii++){
    echo &quot;&lt;div id='memberList$ii' style='display:inline-block;vertical-align:top'&gt;&quot;;
    echo &quot;&lt;fieldset class=fieldname style='display:inline'&gt;&quot;;
    echo &quot;&lt;legend class=name_legend&gt;&quot; . $alphabets[$ii] . &quot;&lt;/legend&gt;&quot;;
    echo &quot;&lt;ul class='list'&gt;&quot;;
    while ($row_usrname = mysqli_fetch_array($usersResult)) { 
      if (strtolower(substr($row_usrname['username'],0,1)) == $alphabets[$ii]) {
        echo '&lt;li&gt;&lt;label for=&quot;'.$row_usrname['username'].'&quot;&gt;'
           . '&lt;input type=&quot;checkbox&quot; id=&quot;'.$row_usrname['username'].'&quot; class=&quot;empCheckBoxClass&quot; name=&quot;employment[]&quot; value=&quot;'.$row_usrname['staff_id'].'&quot; /&gt;'.$row_usrname['username'].'&lt;/li&gt; &lt;/label&gt;';              
      }
    }
    echo &quot;&lt;/ul&gt;&quot;;
    echo &quot;&lt;/fieldset&gt;&quot;;
    echo &quot;&lt;br&gt;&quot;;
    echo &quot;&lt;/div&gt;&quot;;
  }
  echo &quot;&lt;/div&gt;&quot;;
  echo &quot;&lt;/div&gt;&quot;;    
  </code></pre>
  <p>I am able to print names only for <code>A</code>:</p>
  <p><a href="https://i.stack.imgur.com/gzBSn.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/gzBSn.jpg" alt="enter image description here" /></a></p>
  <p>How can I print it for every letter?</p>