MrBillybob Posted August 3, 2007 Share Posted August 3, 2007 Is there anyway to restart a while loop? Kinda like how you restart a for just set $x back to the original value. Link to comment https://forums.phpfreaks.com/topic/63231-solved-while-loop/ Share on other sites More sharing options...
premiso Posted August 3, 2007 Share Posted August 3, 2007 Restarting a while loop does not really make any sense. If you are using an auto increment value, you just have to reset that if a condition is met. A while loop will go on forever while the statement in the while loop is true. Link to comment https://forums.phpfreaks.com/topic/63231-solved-while-loop/#findComment-315141 Share on other sites More sharing options...
Barand Posted August 3, 2007 Share Posted August 3, 2007 same way <?php $a = 0; while ($a < 5) { echo $a; $a++; } $a = 0; while ($a < 5) { echo $a; $a++; } Link to comment https://forums.phpfreaks.com/topic/63231-solved-while-loop/#findComment-315143 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.