how to arrange values according to alphabets in php : hi m working on jobportal project, and wants to arrange values alphabatically according to their starting aplhabet section, according to image.
              
    <span>a</span>
    <?php
		  
	      $sql = "select * from companies";
		  $result = mysqli_query($con, $sql);

		  while($data = mysqli_fetch_array($result))
		  {
			  
			  $company = $data['company_name'];
			  
		?>
     <div class="list-col"> <a href="#"><?php echo $company; ?>(0)</a>  </div>
     <?php
      }
     ?>
     </div>
     </li>
    <li class="loop-entry">
    <div class="col"> <span>b</span>
    <div class="list-col"> <a href="#">Company Name (0)</a> <a href="#">Company 
    Name (0)</a> <a href="#">Company Name (0)</a> <a href="#">Company Name (0)
    </a> <a href="#">Company Name (0)</a> </div>
    </div>
    </li>              
    [i wants to arrange according to this image][1]


  [1]: https://i.stack.imgur.com/6VaCK.png