Hi I am learning php and have a very simple question. In the book I'm reading, it says that variable should be separated by commas like this:Â echo outputitem1,outputitem2,outputitem3,... Code (markup): However in all scripts that I've been editing variable were separated by dots:Â echo outputitem1.outputitem2.outputitem3,... Code (markup): What is the difference? Thanks in advance for the help!
You can use both dots and commas to echo strings and variables with echo, however you can only use dots with print() or return etc. The difference is that when you use dots, every part is concatenated to a single string that will be echoed; while using commas, every part is echoed one by one without any concatenation. I rarely, no...I never use commas because we can't use them for return statements etc. I hope it helps.
exactly as Bogi says, so i would advise you to only use dots as it is easier instead of remembering which to use where