0

Not worked code , why ??????

<?php for ($i = 1; $i <= 10; $i++) {     echo $i; } ?> Parse error: syntax error, unexpected ';', expecting ',' or ')' in ..\Playground\ PHP Parse error: syntax error, unexpected ';', expecting ',' or ')' in ..\Playground\

20th Apr 2018, 5:34 AM
Igor Mamedov
Igor Mamedov - avatar
6 Answers
0
Hi, écho is a function, add brackets.
20th Apr 2018, 5:38 AM
jerome
+ 1
<?php for($i=1; $i<=10; $i++) { echo($i); } ?> Result is 12345678910 https://code.sololearn.com/w7Brcx1QdNLg/?ref=app
20th Apr 2018, 5:49 AM
jerome
0
what???
20th Apr 2018, 5:39 AM
Igor Mamedov
Igor Mamedov - avatar
0
pleas write my code
20th Apr 2018, 5:40 AM
Igor Mamedov
Igor Mamedov - avatar
0
My code must present : 1,2,3,4,5,6,7,8,9,10
20th Apr 2018, 5:41 AM
Igor Mamedov
Igor Mamedov - avatar
0
but no worked
20th Apr 2018, 5:42 AM
Igor Mamedov
Igor Mamedov - avatar