0

Okey here is my code. Why is it creating infinite loop? I know it is because of IF statement condition using assignment operator instead of comparison operator. But shouldn't it just keep skipping it? I am expecting 100-200-200-200-200.

for($i=0; $i<5; $i++){
$debt=0;
            if($i=0){ 
           $debt=100;      
           }else{
            $debt=200;
           }

        echo $debt;
        }

0 Answers0