Why doesn't php use the third variable to exchange the values of two variables?
Why does php not use the third variable to exchange the value of two variables? I believe many inexperienced people are at a loss about this. Therefore, this paper summarizes the causes and solutions of the problem. Through this article, I hope you can solve this problem.
Methods: 1. Use "$b=explode ($a ^, $a."); (2) use $b=explode ("| |", $a. "|. $b); $astatum [1]; $barium [0];"; 3, use "list ($b) = array ($b);".
Operating environment of this tutorial: windows7 system, PHP7.1 version, DELL G3 computer
Php does not use the third variable to exchange the values of two variables
Method 1: use XOR operations
Output result:
Method 2:
Output result:
Method 3:
Output result:
After reading the above, do you understand why php doesn't use the third variable to exchange the values of two variables? If you want to learn more skills or want to know more about it, you are welcome to follow the industry information channel, thank you for reading!