Miscellaneous Operators

There are operators that don't fit into any of the previous categories: the concatenation operator, the variable marker, the reference operator, and others. Table 2.9 lists them.

The concatenation operator is similar to the addition operator except that it joins two strings. I find this operator indispensable. When issuing a print, it is convenient to concatenate several strings. I also use the concatenation operator to build database queries. Listing 2.8 is an example of doing this.

When variables were discussed earlier, it was shown that a dollar sign always precedes the name of a variable. This is true whether the variable is global, local, or a function argument. The operator can be taken to mean, "Use the value stored ...

Get Core PHP Programming: Using PHP to Build Dynamic Web Sites now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.