For loop not executed for float values
due to the representation of floating point numbers for machines - http://en.wikipedia.org/wiki/Floating_point
I would recommend using integer indexes for loops
Use +=to enlarge it, not just a plus. As of now, this is an endless cycle for me.
Edit: For some reason, PHP is not working properly with different types in loops.
This below should work
for($i=0;$i<=100;$i+=4){
echo $i/10."<br>";
}
Here var_dump
int(0)
float(0.4)
float(0.8)
float(1.2)
float(1.6)
int(2)
float(2.4)
float(2.8)
float(3.2)
float(3.6)
int(4)
float(4.4)
float(4.8)
float(5.2)
float(5.6)
int(6)
float(6.4)
float(6.8)
float(7.2)
float(7.6)
int(8)
float(8.4)
float(8.8)
float(9.2)
float(9.6)
int(10)
, , - PHP,