Concatenation operator ('.') : String Concatenation « String « PHP






Concatenation operator ('.')

 
<?
$a = "Hello ";
$b = $a . "World!"; // now $b contains "Hello World!"
$a = "Hello ";
$a .= "World!"; // now $a contains "Hello World!"
?>
  
  








Related examples in the same category

1.A period (.) character is used to combine two separate variables into a single string
2.A string and an integer value are added, and the result is an integer value.
3.Combining a string and a number
4.Concatenating strings together
5.Joining and Disassembling Strings