0

these are two variables with two different values.

$variableone = 'This';
$variabletwo = 'Place';

How do I add variable to to variable one like this with a empty space between "This" and "Place":

$variableone = 'This Place';

and how do i update variable two to have no value like this

$variabletwo = " ";

I would apperciate a answer thanks

Barmar
  • 741,623
  • 53
  • 500
  • 612
Kaylem
  • 1
  • 1

1 Answers1

0

You can use string concatenation

$variableone = 'This';
$variabletwo = 'Place';
$variableone .= (" " . $variabletwo);
$variabletwo = " ";

or string substitution

$variableone = 'This';
$variabletwo = 'Place';
$variableone = "$variableone $variabletwo";
$variabletwo = " ";
Barmar
  • 741,623
  • 53
  • 500
  • 612