PHP String Operators (. and .=)


Example

There are only two string operators:

  • Concatenation of two strings (dot):

    $a = "a";
    $b = "b";
    $c = $a . $b; // $c => "ab"
    
  • Concatenating assignment (dot=):

    $a = "a";
    $a .= "b"; // $a => "ab"