rcorlew Posted March 9, 2007 Share Posted March 9, 2007 I am trying to simply print a series of numbers that will generally be from 1 to less than 100. I have tried and tried an all can seem to print is about a million 1's. Here is what I am starting with and maybe someone could help: <?php $x = 1; $y = 20; for($i = $x; $i <= $y; $x++) { print "$i\n"; } ?> Link to comment https://forums.phpfreaks.com/topic/41920-solved-need-help-printing-series-numbers-between-x-and-y/ Share on other sites More sharing options...
btherl Posted March 9, 2007 Share Posted March 9, 2007 The problem is that you are doing $x++ instead of $i++ Link to comment https://forums.phpfreaks.com/topic/41920-solved-need-help-printing-series-numbers-between-x-and-y/#findComment-203259 Share on other sites More sharing options...
rcorlew Posted March 9, 2007 Author Share Posted March 9, 2007 Perfect fix, thanks!!!! Link to comment https://forums.phpfreaks.com/topic/41920-solved-need-help-printing-series-numbers-between-x-and-y/#findComment-203263 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.