hey yall i would like to take a number and keep adding 20 to it till it get to a certain point then stop for instance, lets say the number is 10. Then i would like to keep adding 20 to it till it gets to say... 100 so it would be something like this 10 30 50 70: and so on till 100. i tried it in a for loop but i could only get it to increment by 1 instead of 20 would be grateful for any solution to this thanks how can i get this result
If its incrementing only by 1, you aren't referncing the loop correctly; e.g <?php for ($x=10; $x<100; $x+=20) { print "number = $x\n"; } ?> PHP: OUTPUT: number = 10 number = 30 number = 50 number = 70 number = 90
tanks luke yea i didn't create the loop like that. for the last part i had it as $x++ instead of $x+=20. thanks for the correction