Multiple choice

Which string concatenation operator returns the concatenation of its right and left arguments?

  1. .= (dot & equal)

  2. =.(equal & dot)

  3. . (dot)

  4. ..(double dots)

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

The dot operator (.) concatenates strings in PHP: \$str = 'Hello' . ' World' results in 'Hello World'. The .= operator concatenates and assigns: \$str .= '!' appends to $str. Option B is nonsensical PHP syntax.