JSHINER Posted October 3, 2007 Share Posted October 3, 2007 for ($n=0;$n<1000;$n+50) This does not seem to give a result of 0, 50, 100 for $n - it seems that when I use this for $n it goes 1,2,3,4 etc. What is wrong with it? Link to comment https://forums.phpfreaks.com/topic/71714-solved-counting-problem/ Share on other sites More sharing options...
michaellunsford Posted October 3, 2007 Share Posted October 3, 2007 the loop usually uses increments -- ($n++) why not: <?php for ($n=0;$n<20;$n++) echo $n*50; ?> Link to comment https://forums.phpfreaks.com/topic/71714-solved-counting-problem/#findComment-361074 Share on other sites More sharing options...
MmmVomit Posted October 3, 2007 Share Posted October 3, 2007 for ($n = 0; $n < 1000; $n = $n + 50) Link to comment https://forums.phpfreaks.com/topic/71714-solved-counting-problem/#findComment-361077 Share on other sites More sharing options...
MadTechie Posted October 3, 2007 Share Posted October 3, 2007 http://www.phpfreaks.com/forums/index.php/topic,161803.msg707750.html#msg707750 Link to comment https://forums.phpfreaks.com/topic/71714-solved-counting-problem/#findComment-361084 Share on other sites More sharing options...
MmmVomit Posted October 3, 2007 Share Posted October 3, 2007 http://www.phpfreaks.com/forums/index.php/topic,161803.msg707750.html#msg707750 Oy, some people. Link to comment https://forums.phpfreaks.com/topic/71714-solved-counting-problem/#findComment-361087 Share on other sites More sharing options...
JSHINER Posted October 3, 2007 Author Share Posted October 3, 2007 I tried that yesterday I must have done it wrong because yesterday it did not work. Link to comment https://forums.phpfreaks.com/topic/71714-solved-counting-problem/#findComment-361212 Share on other sites More sharing options...
JSHINER Posted October 3, 2007 Author Share Posted October 3, 2007 Sorry MadTechie! I missed the $n = there yesterday! Long long day yesterday :) Link to comment https://forums.phpfreaks.com/topic/71714-solved-counting-problem/#findComment-361227 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.