0

I've seen these characters used together in Wordpress PHP, but I'm not sure what they do. An example:

$content .= '' . $title . '';

Pilgrimish
  • 11
  • 5
  • 1
    In the future, this is a great resource, especially because you can't search for symbols in google: [Symbol Reference](http://stackoverflow.com/questions/3737139/reference-what-does-this-symbol-mean-in-php) – James G. Sep 16 '13 at 04:21

5 Answers5

1

That is the short hand version of a concatenation where you say append something to the end of this string itself. It means

$content = $content. $title;
Hanky Panky
  • 46,730
  • 8
  • 72
  • 95
1

Thats a php string concatenation operation. For example

$str1 = "Hello";
$str2 = "World";
$str1 .= " " . $str2; // is equal to writing $str1 = $str1 . " " . $str2;
echo $str1 // will print Hello World
Josnidhin
  • 12,469
  • 9
  • 42
  • 61
1

Same as this :

$content = $content . '' . $title . '';
Fouad Fodail
  • 2,653
  • 1
  • 16
  • 16
1

It is a concatenation assignment operator

$x="Hello";
$x .= " world!";
echo $x; // outputs Hello world! 
Lazik
  • 2,480
  • 2
  • 25
  • 31
1

$a .= $b means $a = $a . $b

This also apply to some other operations such as +, -, *, /, ... For example:

$a += $b    => $a = $a + $b
$a -= $b    => $a = $a - $b
$a *= $b    => $a = $a * $b
$a /= $b    => $a = $a / $b
invisal
  • 11,075
  • 4
  • 33
  • 54