Loop goes from 0 to 100 in steps of 0.1 : for loop « Statement « PHP
- PHP
- Statement
- for loop
Loop goes from 0 to 100 in steps of 0.1
<?php
for ($i = 0; $i < 100; $i += 0.1) {
if ($i == 50) echo '$i == 50' . "\n";
if ($i >= 50 && $i < 50.1) echo '$i >= 50 && $i < 50.1' . "\n";
}
echo $i;
?>
Related examples in the same category