+ 1
What's wrong with this PHP code?
After I copied out the code to run it the way it was posted in quiz I got an error message but when I guessed the value it correct. what could be error there function func(args){ $result =0; for ($i=0; $arg; $i++){ $result = $result +$I; } return $result; } echo func(5); please help a learner
4 Answers
+ 7
Well this is my solution
https://code.sololearn.com/wACFzVYSuv05/?ref=app
+ 4
There are two errors in for loop $arg should become $i<$args and $l shoud become $i
+ 4
I fixed the code, I will help you make changes.
first post the code here in a comment.
[ PRESS ]
+ ( in new comment box)
[ INSERT CODE]
- select the code
+ 1
Thanks. lemme run it again