0
Why i should use dot in the above line before and after $num
echo "Counter is ".$num."<br />";
2 Answers
+ 1
to separate variable from string. Your string is constant, but variables can be dynamic. For more information comment
0
with the dot you concat strings so in this line you put the two strings and the var $num into one big string and then bring it to the output.
you could also use: echo "Counter is $num <br/>";
this would inject the value of $num in the String.
but you have to use the doubled " !
this does not work with single '