Ive got this code thats looking at C to see if its even, if it is it adds it to D and then C is increased by 2 to get the next even number.
I know ive done it a wierd way, but it hay.
Anyway, my issue is, is that I want the numbers to display like this:
30 32 34 36 38 40
but at the moment its just summing all the numbers together.
Any ideas?
Thanks
Pritty simple stuff, but I dont work with numbers in PHP.
So you know, i then use the D variable somewhere else in my code.
I know ive done it a wierd way, but it hay.
Anyway, my issue is, is that I want the numbers to display like this:
30 32 34 36 38 40
but at the moment its just summing all the numbers together.
Any ideas?
Thanks
Pritty simple stuff, but I dont work with numbers in PHP.
PHP:
$c = 30;
while($c>=30 && $c<=40 && $c%2==false):
$d = $d + $c;
$c=$c+2;
endwhile;
So you know, i then use the D variable somewhere else in my code.