How to realize the Exchange of two variables by php
This article mainly introduces php how to achieve the exchange of two variables, has a certain reference value, interested friends can refer to, I hope you can learn a lot after reading this article, the following let Xiaobian take you to understand.
Exchange of two variables
/ / method 1: it is relatively clear that a variable generates $temp = $a / b / b = $temp;// method 2: it is relatively clear, but it will also generate a temporary variable list ($b, $a) = [$a * *]; / / Mode 3: reciprocal operations are reliable in integer operations, but +-* / precision may be lost or overflowed $a = $a + $btertingb = $a-$bterterfuroa = $a-$b Thank you for reading this article carefully. I hope the article "how to achieve the exchange of two variables in php" shared by the editor will be helpful to everyone. At the same time, I also hope that you will support us and pay attention to the industry information channel. More related knowledge is waiting for you to learn!