PHP add more data onto a variable via concatentation
PHP allows you to add more data onto a variable using the dot (.) or concatenation operator.
$var = "A sentence.";
$var .= "A second sentence.";
echo $var; //results in:
A sentence. A second sentence.
I used to use variable concatenation to collect blocks of data into a single variable and then just echo the single variable. It seems like a good idea rather than have a half a dozen echo statements littered throughout a function. However it appears that echos are a little bit faster because they display data as it becomes available. Where as collecting the data into a single variable and echoing that is slower because the data can only be displayed once it's all collected.
However there are plenty of instances where variable concatenation makes sense and will save you from having declare extra variables or write the $var = $var."some text"; line.