I learned through correcting parse errors when I started. Here's a few examples that might make the reading a little easier if you're struggling:
print "I drive a " . $year . " " . $make . " " . $model . " that's from a dealership near my house";
Notice that when I print the variables, i have space . space on each side. In some places i have quote space quote. Those are spaces between the variables so when it prints it's not all one word. Because i'm using double quotes to concatenate, the single quote in that's doesn't cause an error. If I was using single quotes to concatenate the exact same line, then it'd cause an error
print 'I drive a ' . $year . ' ' . $make . ' ' . $model . ' that's from a dealership near my house';
Notice the syntax highlight (red vs. blue) in both examples. By having a single quote in my text, the PHP thinks that it is the next quote in sequence in my concatenation. In that case, I would need to escape the single quote using a backslash like so: that\'s
Another example
$sql = "SELECT * FROM mytable WHERE username='".$username."'";
Once again, since I'm using double quotes to concatenate, the single quotes are part of the string. So when this prints, it will show something like:
SELECT * FROM mytable WHERE username='cgraz'
and the username will be surrounded by single quotes. Also as bradgrafelman mentioned in his post, .= can also be used to add onto an existing variable like this:
$msg = "Welcome to PHPBuilder. ";
$msg .= "Here you will find forums relating to PHP.";
will print: Welcome to PHPBuilder. Here you will find forums relating to PHP.
whereas
$msg = "Welcome to PHPBuilder. ";
$msg = "Here you will find forums relating to PHP.";
will print
Here you will find forums relating to PHP.
That's because the .= adds onto the variable message, whereas without it, I'm just changing the value of $msg.
Oh and one last example: If you had $file = 'test' and $ext = ".php", you wouldn't need any space when concatenating between them, so you could do this:
print "Filename is " . $file . $ext;