Adding Numbers In Loop... what am I missing or doing wrong?

Hi

I want to start with a number of .01 at the start of a loop and add 0.25 each time it loops in PHP 7.3.

Here is the very stripped down code:

$x = 0.01;

while($x <= 5) {
echo “The number is: $x
”;
$x + 0.25;
}

What am I doing wrong or missing?

mrmbarnes

That + should be +=

That’s it… I knew it would be something simple… thanks for your help!

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.