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"; } ?> Quote Link to comment 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++ Quote Link to comment Share on other sites More sharing options...
rcorlew Posted March 9, 2007 Author Share Posted March 9, 2007 Perfect fix, thanks!!!! Quote Link to comment 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.