+ 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

14th Mar 2018, 11:26 PM
MidecodeablešŸ‘ØšŸ»ā€šŸ’»
MidecodeablešŸ‘ØšŸ»ā€šŸ’» - avatar
4 Answers
15th Mar 2018, 5:21 AM
Manual
Manual - avatar
+ 4
There are two errors in for loop $arg should become $i<$args and $l shoud become $i
14th Mar 2018, 11:36 PM
Vladi Petrov
Vladi Petrov - avatar
+ 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
14th Mar 2018, 11:42 PM
Manual
Manual - avatar
+ 1
Thanks. lemme run it again
14th Mar 2018, 11:37 PM
MidecodeablešŸ‘ØšŸ»ā€šŸ’»
MidecodeablešŸ‘ØšŸ»ā€šŸ’» - avatar