php - Why does $n = $n + $n not work -
i've tried out code use loop in php add numbers seems not work, how can be?
$n = 3; //or else for($i=0;$i<$n;$i++){ $n = $n+$n; } echo $n;
this test code else, i'd still work, please help
you increasing loop ending condition $n inside loop
this means never exit loop.
this infinite loop, , wont ever print anything.
also loop needs $i = 0; $i < $n; $i++
Comments
Post a Comment