+ 1
Write a Program to swap two numbers in PHP.
2 Answers
+ 5
<?php
$a=101;
$b=202;
$a=[$b,$b=$a][0];
echo $a.":".$b;
?>
Oh wait. you want only number. But mine do any type of value.... :(
+ 1
<?php
$a = 25;
$b = 32;
$a ^= $b;
$b ^= $a;
$a ^= $b;
echo $a;
echo "\n";
echo $b;
?>