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. Quote 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. Quote 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++; } Quote Link to comment https://forums.phpfreaks.com/topic/63231-solved-while-loop/#findComment-315143 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.