1. Home
  2. FAQ
  3. PHP FAQ
  4. Combine Two Strings

Combine Two Strings

How to Combine Two Strings in PHP

The PHP programming language uses dot (.) operator to create singe string by combining two strings. This operator is specifically designed for strings. You can use this operation in multiple ways.

Example 1:

You can also concatenate one string and other string variable. For example:

You can also concatenate with assignment operator (‘.=’), which appends the argument on the right side to the argument on the left side. For example:

Tags , ,