October 2005
Intermediate to advanced
372 pages
11h 35m
English
There are only two string operators in PHP: concatenation and shorthand concatenation . Both are shown in Table 6-3.
Table 6-3. The string operators
|
. |
Concatenation |
Returns the second value appended to the first: |
|
.= |
Shorthand concatenation |
Appends the second value to the first: |
These operators are used to join strings together, like this:
$first = "Hello, ";
$second = "world!";
// join $first and $second; assign to $third
$third = $first . $second;
// $third is now "Hello, world!"
$first .= " officer!";
// $first is now "Hello, officer!"