0

For loop error

I try this for (for loop) For($q = 15;$q < 20; $q++) { echo $q "<br/>" ; } And it shows this error Parse error: syntax error, unexpected '' '' (T_CONSTANT_ENCAPSED_STRING), expecting ',' or ';' in ..\Playground\ PHP Parse error: syntax error, unexpected '' '' (T_CONSTANT_ENCAPSED_STRING), expecting ',' or ';' in ..\Playground\ Can someone help me? Plz

10th Jun 2018, 5:27 PM
Ash
4 Answers
+ 1
You must add . between $q and br. ex: echo $q . "<br/>";
10th Jun 2018, 5:31 PM
AtoMX
AtoMX - avatar
+ 1
thnx AtoMx very much
10th Jun 2018, 6:37 PM
Ash
0
but why sometimes ,some code work without these . ,but why i need these . here??đŸ€”đŸ€”đŸ€”đŸ€”
10th Jun 2018, 5:33 PM
Ash
0
In this case the point is used to concatenate strings. You can use echo without point if you print only one variable or only one string.
10th Jun 2018, 6:36 PM
AtoMX
AtoMX - avatar