0
Can some one help me to understand this PHP question please? $result = 0; and $i = 0; how can their addition be 10???
function func($arg) { $result = 0; for($i=0; $i<$arg; $i++) { $result = $result + $i; } return $result; } echo func(5);
1 ответ
0
1+2+3+4=10
The for loop add the numbers
http://www.w3schools.com/php/php_looping_for.asp