变量互换
##方法1
$a= 3;
$b=4;
$a.=$b;
$b = substr($a, 0,strlen($a)-strlen($b));
$a = substr($a, strlen($b));
echo $a,'-',$b;
##方法2
$a= 3;
$b=4;
list($a,$b) = [$b,$a];
echo $a,'-',$b;
本文档由 Jerry.Chen 维护更新
##方法1
$a= 3;
$b=4;
$a.=$b;
$b = substr($a, 0,strlen($a)-strlen($b));
$a = substr($a, strlen($b));
echo $a,'-',$b;
##方法2
$a= 3;
$b=4;
list($a,$b) = [$b,$a];
echo $a,'-',$b;