Syntax

PHP Concatenate Strings Syntax

In PHP, concatenate strings: joins strings with a dot — $full = $first . " " . $last;

Quick Answer

Syntax
$full = $first . " " . $last;
PHPSyntax

Concatenate Strings

Code example
$full = $first . " " . $last;

Joins strings with a dot.

Learn More

How to concatenate strings in PHP

  1. Open your PHP file or editor.
  2. Copy the example, then replace its sample names and values for your code.

PHP Concatenate Strings Syntax

Use $full = $first . " " . $last;.

Related Syntax References

Frequently asked questions

What is the PHP syntax for concatenate strings?

Use this pattern: $full = $first . " " . $last;

Can I copy this PHP code example?

Yes. Use Copy code and adapt the example to your program.

Is this PHP syntax different on Mac or Windows?

No. The language syntax is the same across operating systems.

Official source · How we verify