Dss.Lexius Posted June 12, 2010 Share Posted June 12, 2010 Hi, can i use multiple loops in a while loop? any example f doing this? Thanx Link to comment https://forums.phpfreaks.com/topic/204555-while-loop-in-while-loop/ Share on other sites More sharing options...
kenrbnsn Posted June 12, 2010 Share Posted June 12, 2010 Yes. A while loop is like any other loop in PHP, so it can contain any other loop. Why are you asking? Ken Link to comment https://forums.phpfreaks.com/topic/204555-while-loop-in-while-loop/#findComment-1071111 Share on other sites More sharing options...
Dss.Lexius Posted June 12, 2010 Author Share Posted June 12, 2010 does it use too much RAM/Processor usage? Link to comment https://forums.phpfreaks.com/topic/204555-while-loop-in-while-loop/#findComment-1071123 Share on other sites More sharing options...
kenrbnsn Posted June 12, 2010 Share Posted June 12, 2010 What are you trying to do? There is no one answer for your question. Ken Link to comment https://forums.phpfreaks.com/topic/204555-while-loop-in-while-loop/#findComment-1071126 Share on other sites More sharing options...
Dss.Lexius Posted June 12, 2010 Author Share Posted June 12, 2010 can you please provide a piece of code which contains multiple loops in one single loop? Just for Example... Link to comment https://forums.phpfreaks.com/topic/204555-while-loop-in-while-loop/#findComment-1071132 Share on other sites More sharing options...
kenrbnsn Posted June 12, 2010 Share Posted June 12, 2010 <?php $x = 1; while ($x < 10) { $y = 10; while ($y < 100) { echo $x * $y . "<br>\n"; $y += 10; } $x++; } ?> Ken Link to comment https://forums.phpfreaks.com/topic/204555-while-loop-in-while-loop/#findComment-1071133 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.