I've done it before.Php The interview question is this:Swapping values for two variables without using the third variable . In general, the Third intermediate variable is used to realize the value exchange of the original two variables, but this problem does not require the use of intermediate variables, which for beginners is a problem. Some of the methods found online are summarized as follows:
= "a"= "B"' $a before Exchange: '.. ', $b: '..'
'.==(, 0, (()-(=(,(' After exchange $ A: '.. ', $b: '..'
''-----------------------
'= "a"= "B"' $a before Exchange: '.. ', $b: '..'
'.==(, "",=(, "",' After exchange $ A: '.. ', $b: '..'
''-----------------------
'= "a"= "B"' $a before Exchange: '.. ', $b: '..'
'(,)=(,' After exchange $ A: '.. ', $b: '..'
''-----------------------
'= ' A '= ' B '' $a before Exchange: '.. ', $b: '..'
'=^=^=^' After exchange $ A: '.. ', $b: '..'
''-----------------------
'=3=5' $a before Exchange: '., $b: '. . '
' =+
= -
=-
' Exchange $a: '. , $b: '. . '
';
http://www.bkjia.com/phpjc/440328.html www.bkjia.com true Span id= "Isbasedonurl" itemprop= "Isbasedonurl" >http://www.bkjia.com/phpjc/440328.html techarticle ve done a PHP interview question before: The value of two variables is exchanged without the use of a third variable. In general, the Third intermediate variable is used to realize the value exchange of the original two variables ...