0

In this code

$x = 1;
$y = 2;
echo $x.$y; //12

I want to replace $x and $y vlaues with each other, So $x = 2 and $y = 1, Is that possible to be achieved without assigning middle-variables? Something like using a ready-function or like

$x = 1;
$y = 2;
echo $x.$y; //12
$x = &$y;
$y = &$x;
echo  $x.$y //22

But instead of 22 I want to get 21.

Toleo
  • 764
  • 1
  • 5
  • 19

0 Answers0