Concatenate two variables in new variable in php

A simple one!

In PHP, you can concatenate two variables using the dot (.) operator. Here's an example:

$var1 = "Hello";
$var2 = "World";
$newVar = $var1. " ". $var2;

The resulting value of $newVar would be "Hello World".

Alternatively, you can use the concatenation operator (.) with a string literal:

$var1 = "Hello";
$var2 = "World";
$newVar = $var1. " ". 'World';

This would also result in "Hello World".

Note that you can concatenate more than two variables by adding more dot operators:

$var1 = "Hello";
$var2 = "World";
$var3 = "!";
$newVar = $var1. " ". $var2. " ". $var3;

This would result in "Hello World!".