The best replacement for while loop is for loop.

The best alternatives to while loop are rated as following:
★★★★★  for loop
★★  cursor
★  do while
★  while loop
★  do while loop
★  recursion
★  for loop is faster
★  cursor sql server
  if statement
  do loop
  cursor sybase

Your alternative for while loop is not listed? Suggest!
Speaking about while loop, one probably shouldn't forget about array php.

Other search terms related to while loop and their ratings are:

★★★★★ array php
★★★★ fgets
You have in mind a companion for while loop and it is not yet here? Propose!

Google Trends

Scale is based on the average worldwide traffic of while loop in all years. Click on graph for more.
while loop
for loop