Skip to content

Latest commit

 

History

History
26 lines (20 loc) · 846 Bytes

File metadata and controls

26 lines (20 loc) · 846 Bytes

⌂ Home ▲ Previous: Assignment operators ▼ Next: Array operators

String operators

There are two string operators. The first is the concatenation operator (.), which returns the concatenation of its right and left arguments. The second is the concatenating assignment operator (.=), which appends the argument on the right side to the argument on the left side.

Example: String concatenating

<?php
$a = "Hello ";
$b = $a . "World!"; // now $b contains "Hello World!"
var_dump($b);

$a = "Hello ";
$a .= "World!";     // now $a contains "Hello World!"
var_dump($a);
?>

▵ Up ⌂ Home ▲ Previous: Assignment operators ▼ Next: Array operators